Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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?

    #399191

    Hey 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!
    Elliott

    #399204

    Hi 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…

    #399213
    This reply has been marked as private.
    #399473

    Hi!

    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,
    Ismael

    #399517

    Hi Ismael, I tried to add the code but without success. Nothing happened.

    #399999

    Hi, I just found the issue… problem solved!

    #400053

    Hey!

    Glad you figured it out. Mind sharing the fix?

    Best regards,
    Ismael

    #400092

    Hi 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…

    #401252

    Hey!

    I see. Glad you fixed it. ;)

    Regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Navigation arrows not working on portfolio neither with function added.’ is closed to new replies.