Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #185028

    Looking for a way to disable the Previous and Next arrows that show on the sides of a post.
    Can this only be done globally or can the control be left to the individual post where a toggle could be added on the post page?
    Not a feature request just an idea if the only option is all or nothing.

    Anyway…how does one remove the previous and back links?
    Thanks in advance

    #185231

    Hey Monsoon!

    Please add following code to Quick CSS in Enfold theme options under Styling tab

    #top .avia-post-nav { display: none; }

    Best regards,
    Yigit

    #216672

    Hi Yigit,

    The Quick CSS you offered to Monsoon worked great for disabling the Previous and Next arrows on the sides of posts globally. However, is it possible to disable it for custom posts (e.g., WooCommerce shop products or Events Planner events) but keep it enabled for regular posts (i.e., blog)?

    Thanks in advance.

    #216751

    Hi!

    You can add following code to Quick CSS to remove only from single product pages

    .single-product .avia-post-nav { display: none!important; }

    Regards,
    Yigit

    #238118

    Hello,

    I have read this post with interest.

    Anyway, how could such structure be completely removed, so that the code is lighter?

    Could you please indicate which files are to be edited?

    Thank you.

    #238172

    Hey!

    You can find the avia post navigation functions on functions-enfold.php:

    if(!function_exists('avia_post_nav'))
    {
    	function avia_post_nav($same_category = false, $taxonomy = 'category')
    	{
    		global $wp_version;
    	        $settings = array();
    	        $settings['same_category'] = $same_category;
    	        $settings['excluded_terms'] = '';
    		$settings['wpversion'] = $wp_version;
            
    		//dont display if a fullscreen slider is available since they overlap 
    		if((class_exists('avia_sc_layerslider') && !empty(avia_sc_layerslider::$slide_count)) || 
    			class_exists('avia_sc_slider_full') && !empty(avia_sc_slider_full::$slide_count) ) $settings['is_fullwidth'] = true;
    
    		$settings['type'] = get_post_type();
    		$settings['taxonomy'] = ($settings['type'] == 'portfolio') ? 'portfolio_entries' : $taxonomy;
    
    		if(!is_singular() || is_post_type_hierarchical($settings['type'])) $settings['is_hierarchical'] = true;
    		if($settings['type'] === 'topic' || $settings['type'] === 'reply') $settings['is_bbpress'] = true;
    
    	        $settings = apply_filters('avia_post_nav_settings', $settings);
    	        if(!empty($settings['is_bbpress']) || !empty($settings['is_hierarchical']) || !empty($settings['is_fullwidth'])) return;
    	
    	        if(version_compare($settings['wpversion'], '3.8', '>=' ))
    	        {
    	            $entries['prev'] = get_previous_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']);
    	            $entries['next'] = get_next_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']);
    	        }
    	        else
    	        {
    	            $entries['prev'] = get_previous_post($settings['same_category']);
    	            $entries['next'] = get_next_post($settings['same_category']);
    	        }
    	        
    		$entries = apply_filters('avia_post_nav_entries', $entries, $settings);
            	$output = "";
    
    		foreach ($entries as $key => $entry)
    		{
                if(empty($entry)) continue;
    
                $tc1   = $tc2 = "";
                $link  = get_permalink($entry->ID);
                $image = get_the_post_thumbnail($entry->ID, 'thumbnail');
                $class = $image ? "with-image" : "without-image";
    
                $output .= "<a class='avia-post-nav avia-post-{$key} {$class}' href='{$link}' >";
    		    $output .= "    <span class='label iconfont' ".av_icon_string($key)."></span>";
    		    $output .= "    <span class='entry-info-wrap'>";
    		    $output .= "        <span class='entry-info'>";
    		    $tc1     = "            <span class='entry-title'>".avia_backend_truncate(get_the_title($entry->ID),75," ")."</span>";
    if($image)  $tc2     = "            <span class='entry-image'>{$image}</span>";
                $output .= $key == 'prev' ?  $tc1.$tc2 : $tc2.$tc1;
                $output .= "        </span>";
                $output .= "    </span>";
    		    $output .= "</a>";
    		}
    		return $output;
    	}
    }
    

    Best regards,
    Ismael

    #238574

    Thank you Ismael,

    I commented out as follow, and apparently it works in /enfold/functions-enfold.php…

    in the code block starting as… if(!function_exists(‘avia_post_nav’))

    if(version_compare($settings[‘wpversion’], ‘3.8’, ‘>=’ ))
    {
    // $entries[‘prev’] = get_previous_post($settings[‘same_category’], $settings[‘excluded_terms’], $settings[‘taxonomy’]);
    // $entries[‘next’] = get_next_post($settings[‘same_category’], $settings[‘excluded_terms’], $settings[‘taxonomy’]);
    }
    else
    {
    // $entries[‘prev’] = get_previous_post($settings[‘same_category’]);
    // $entries[‘next’] = get_next_post($settings[‘same_category’]);
    }

    Thank you for your assistance.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Enfold – Disable previous and next post arrows on posts’ is closed to new replies.