Tagged: Masonry Gallery, navigation, Portfolio
-
AuthorPosts
-
February 19, 2015 at 6:06 pm #399094
Hi, I searched on this forum how to activate the navigation arrows on Portfolio items which have a Masonry Gallery.
I found this solution and I tried adding it to functions.php of my child theme and it didn’t work: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; }
How can I fix that?
February 19, 2015 at 7:34 pm #399191Hey Raphael!
I’m sorry but I’m not sure I understand. Are you referring to the post navigation that displays in the single portfolio view?
Like on this portfolio post, http://kriesi.at/themes/enfold/portfolio-item/single-portfolio-big-slider-3/, the black arrows on the sides of the post.
Go ahead and take a screenshot and highlight what your trying to do so we can get a better idea.
Cheers!
ElliottFebruary 19, 2015 at 7:46 pm #399204Hi Elliott, yes, I’m trying to activate that navigation arrows. I read that enfold deactivates it when there’s a fullwidth element. So I tried to add that code on functions.php of the child theme to activate it, but it didn’t work…
February 19, 2015 at 7:54 pm #399213This reply has been marked as private.February 20, 2015 at 7:21 am #399473Hi!
Add the whole avia_post_nav function on the child theme’s functions.php:
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'] = false; $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; }
Regards,
IsmaelFebruary 20, 2015 at 10:15 am #399517Hi Ismael, I tried to add the code but without success. Nothing happened.
February 21, 2015 at 6:34 am #399999Hi, I just found the issue… problem solved!
February 21, 2015 at 12:25 pm #400053February 21, 2015 at 5:11 pm #400092Hi Ismael, the problem was that I created the portfolio items directly on the database wp_posts table and uploaded it, so WordPress didn’t connect all the functionalities of the Portfolio Item because they wasn’t created in the standard way. I’ll create manually all the portfolio items and the problem doesn’t appear…
February 24, 2015 at 10:21 am #401252 -
AuthorPosts
- The topic ‘Navigation arrows not working on portfolio neither with function added.’ is closed to new replies.