Tagged: post navigation
I looked at a dozen tickets on this, tried implementing function code
add_filter('avia_post_nav_settings','avia_remove_fullwidth_slider_check', 10, 1);
function avia_remove_fullwidth_slider_check($settings)
{
$settings['is_fullwidth'] = false;
return $settings;
}
And CSS, but I can not get the next/prev buttons to work? I do have it enabled in the theme control panel.
Hey lzevon,
Thank you for the inquiry.
Try to set the skip_output parameter to false to make sure that the navigation is displayed in the post.
/**
* Use the following as a frame for customization
*
* @since 4.5.6
* @param array $settings
* @return array
*/
function my_avf_post_nav_settings( array $settings )
{
/**
* Skips e.g. pages.
*
* get_previous_post() and get_next_post does not support hierarchical post types by default.
* You need to implement your own logic.
*/
if( true === $settings['is_hierarchical'] )
{
$settings['skip_output'] = true;
return $settings;
}
/**
* Limit post types you want to have navigation
*/
if( ! in_array( $settings['type'], array( 'post', 'portfolio' ) ) )
{
$settings['skip_output'] = true;
return $settings;
}
/**
* Add other settings
*/
$settings['same_category'] = false;
$settings['is_fullwidth'] = false;
/**
* Make sure we show navigation
*/
$settings['skip_output'] = false;
return $settings;
}
add_filter( 'avf_post_nav_settings', 'my_avf_post_nav_settings', 10, 1 );
Best regards,
Ismael
Awesome, thank you Ismael!
Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan Shannon