Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1266062

    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.

    #1266982

    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 );
    

    // https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/Layout/avf_post_nav_settings.php

    Best regards,
    Ismael

    #1267253

    Awesome, thank you Ismael!

    #1267311

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Next / Previous Post not working’ is closed to new replies.