Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #761874

    I want to remove next and previous arrows in blog posts. I found some solutions to hide it by css. But i want to remove it completely. Tell me which lines in function.php to remove.

    I also want to know how to remove feature image above title in posts. No posts in my website have image.

    my website http://705.987.myftpupload.com/test-2/

    #761880

    Hey pmwarman!

    Please add following code to Functions.php file in Appearance > Editor

    add_filter('avia_post_nav_entries','avia_remove_post_nav', 10, 1);
    function avia_remove_post_nav()
    {
    return false;
    }

    Regards,
    Yigit

    #761891

    It’s working. But some error showing in footer

    Warning: Invalid argument supplied for foreach() in /home/content/p3pnexwpnas03_data03/67/3951467/html/wp-content/themes/enfold/functions-enfold.php on line 482

    705.987.myftpupload.com/test-2/

    • This reply was modified 7 years, 9 months ago by pmwarman.
    #761897

    Hey!

    Please add the code to bottom of functions.php and not in functions-enfold.php file

    Best regards,
    Yigit

    #761901

    I added in function.php . Still same error showing

    #761904

    Hi,

    Please post FTP and WP logins here privately if you would like us to look further into it

    Best regards,
    Yigit

    #761908

    Here it is

    #761911

    Hey!

    Can you please post FTP logins here privately as well?

    Best regards,
    Yigit

    #761919

    Ftp details

    #761967

    still error showing http://705.987.myftpupload.com/test-2/.

    when my problem solved? and i also asked another question, how to remove feature image above title in posts?

    • This reply was modified 7 years, 9 months ago by pmwarman.
    #762057

    Hi,

    You can try just comment the post_nav function at the functions-enfold.php in line 444 to 506. To facilitate, replace the code by this:

    
    /*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;
    			$the_title 	= isset($entry->av_custom_title) ? $entry->av_custom_title : avia_backend_truncate(get_the_title($entry->ID),75," ");
    			$link 		= isset($entry->av_custom_link)  ? $entry->av_custom_link  : get_permalink($entry->ID);
    			$image 		= isset($entry->av_custom_image) ? $entry->av_custom_image : get_the_post_thumbnail($entry->ID, 'thumbnail');
    			
                $tc1   = $tc2 = "";
                $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'>{$the_title}</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;
    	}
    }
    */
    
    

    Let me know if it works :)

    Best regards,
    John Torvik

    #762075

    Not working. New Error

    Fatal error: Call to undefined function avia_post_nav() in /home/content/p3pnexwpnas03_data03/67/3951467/html/wp-content/themes/enfold/footer.php on line 155

    #762079

    Below Code i replaced

    
    
    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;
    			$the_title 	= isset($entry->av_custom_title) ? $entry->av_custom_title : avia_backend_truncate(get_the_title($entry->ID),75," ");
    			$link 		= isset($entry->av_custom_link)  ? $entry->av_custom_link  : get_permalink($entry->ID);
    			$image 		= isset($entry->av_custom_image) ? $entry->av_custom_image : get_the_post_thumbnail($entry->ID, 'thumbnail');
    			
                $tc1   = $tc2 = "";
                $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'>{$the_title}</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;
    	}
    }
    
    #762202

    Hi,

    If you check my code, youll see that I commented the function with /* */ - I can do it for you, but I tried to access your FTP and theres some wrong credential, may you check and provide me again?

    Best regards,
    John Torvik

    #762236

    Above ftp details is correct. I tested it. It working fine. please try again

    • This reply was modified 7 years, 9 months ago by pmwarman.
    #762244

    I added /* and */ . Error still showing and admin bar not working. It went all black. no menu option in admin bar is visible.

    screen shot

    .

    #762484

    any solution?

    #762715

    I removed some lines in function. now Error not showing. Problem solved. Thanks for the support

    #763834

    Hi,

    glad you could solve it. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.

    Best regards,
    Andy

Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘How to Remove Previous and Next Arrows In Posts Using Functions.php’ is closed to new replies.