-
AuthorPosts
-
March 16, 2017 at 1:23 pm #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/
March 16, 2017 at 1:33 pm #761880Hey 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,
YigitMarch 16, 2017 at 1:39 pm #761891It’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.
March 16, 2017 at 1:40 pm #761897Hey!
Please add the code to bottom of functions.php and not in functions-enfold.php file
Best regards,
YigitMarch 16, 2017 at 1:47 pm #761901I added in function.php . Still same error showing
March 16, 2017 at 1:58 pm #761904Hi,
Please post FTP and WP logins here privately if you would like us to look further into it
Best regards,
YigitMarch 16, 2017 at 2:05 pm #761908Here it is
March 16, 2017 at 2:11 pm #761911March 16, 2017 at 2:16 pm #761919Ftp details
March 16, 2017 at 3:17 pm #761967still 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.
March 16, 2017 at 4:47 pm #762057Hi,
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 TorvikMarch 16, 2017 at 5:24 pm #762075Not 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
March 16, 2017 at 5:31 pm #762079Below 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; } }
March 16, 2017 at 9:04 pm #762202Hi,
If you check my code, you
ll see that I commented the function with /* */ - I can do it for you, but I tried to access your FTP and there
s some wrong credential, may you check and provide me again?Best regards,
John TorvikMarch 16, 2017 at 10:20 pm #762236Above ftp details is correct. I tested it. It working fine. please try again
- This reply was modified 7 years, 9 months ago by pmwarman.
March 16, 2017 at 10:33 pm #762244I added /* and */ . Error still showing and admin bar not working. It went all black. no menu option in admin bar is visible.
.
March 17, 2017 at 1:58 pm #762484any solution?
March 17, 2017 at 8:50 pm #762715I removed some lines in function. now Error not showing. Problem solved. Thanks for the support
March 20, 2017 at 10:20 pm #763834Hi,
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 -
AuthorPosts
- The topic ‘How to Remove Previous and Next Arrows In Posts Using Functions.php’ is closed to new replies.