Hide Portfolio Navigation Items for Specific Portfolio Items

Thanks for helping look into this issue and providing some debugging.

I have the GoDaddy! Basic Managed Wordpress plan. It does not provide a staging area. Is this something I can create anyway? Will moving everything over break the site and it’s integration to plugins?

Is this what I have do? http://www.wpbeginner.com/wp-tutorials/how-to-create-staging-environment-for-a-wordpress-site/

Want to make sure we’re thinking that’s the issue before taking on all that effort. I’m also noticing the navigation is still not even keeping the entries within the portfolio category. I’m still seeing items from the YOGA and LIFTING portfolio categories appear. Would that be explained by the caching issue, too?

Thanks,
David

Hi David,

Yes, that link will help you setup staging site. The purpose of creating a staging site is to figure out the cause of the issue without interfering your live site. It might be cache or transient or something else. After this issue, staging site can be used for theme and plugin updates. We can do updates on staging site first before pushing it on the live site.

Yay! I solved my portfolio item issue. I cleared my browser cache and deleted all the portfolio items from the demo version. Then I updated the navigation code to the following:

  $prev_post = get_adjacent_post( true, '', true, 'portfolio-category' );
  $next_post = get_adjacent_post( true, '', false, 'portfolio-category' );

Now, all that is left is to set the “back to entry page” icon (nine black squares in the upper left) to the Adventure page which is the summary. Is there a way to do that?

For example, I’d like the portfolio navigation back to entry page (nine black squares) on this page:

to navigate back to this page:
http://courageouscaterpillar.com/adventures/

Thanks for your assistance!

Hi there @djtremendousg,

Awesome! Glad to hear you got that part figured out. Now throughout this thread we have strayed into the more custom development area, rather than a straigh up support. Saying that though, I can direct you on roughly what you need to do, but can’t provide specific code as that’s more custom development.

If you open up x/framework/functions/ethos.php, line: 195-219 you’ll see this code block:

// Entry Top Navigation
 // =============================================================================```

 ``if ( ! function_exists( 'x_ethos_entry_top_navigation' ) ) :
 function x_ethos_entry_top_navigation() {```

   if ( x_is_portfolio_item() ) {
     $link = x_get_parent_portfolio_link();
   } elseif ( x_is_product() ) {
     $link = x_get_shop_link();
   }

   $title = esc_attr( __( 'See All Posts', '__x__' ) );

   ?>

     <div class="entry-top-navigation">
       <a href="<?php echo $link; ?>" class="entry-parent" title="<?php $title; ?>"><i class="x-icon-th" data-x-icon="&#xf00a;"></i></a>
       <?php x_entry_navigation(); ?>
     </div>

   <?php

```  }
endif;```

This code where you see the echo $link output is the part you need to override, to link that back to the summary, technically you could do that dynamically or hard code it, but any modification does need to be in the child theme and not in the parent theme. 

Thanks!

Thanks for pointing me towards a possible solution. I’ve added a child theme x-child/framework/functions/ethos.php file to my site as a clone of the same file from the parent x theme. The only thing I modified was hardcoding the entry-parent href value like this:

<div class="entry-top-navigation">
        <a href="http://courageouscaterpillar.com/adventures/" class="entry-parent" title="<?php $title; ?>"><i class="x-icon-th" data-x-icon="&#xf00a;"></i></a>

The source of the runtime page looks like the following pointing back to the same page with entry-parent icon:

<div class="entry-top-navigation">
	<a href="http://courageouscaterpillar.com/costa-rica/" class="entry-parent" title=""><i class="x-icon-th" data-x-icon="&#xf00a;"></i></a>

One thing I’m noticing though is this isn’t the exact URL for the portfolio page. The actual URL is http://courageouscaterpillar.com/item/costa-rica/. Looks like the “item/” part was removed.

I’ve even tried hardcoding the code above setting the $link value:

if ( x_is_portfolio_item() ) {
      $link = ‘http://courageouscaterpillar.com/adventures/';
    } elseif ( x_is_product() ) {
      $link = ‘http://courageouscaterpillar.com/adventures/';
    }

The source of the runtime page still looks like the following pointing back to the same page with entry-parent icon:

<div class="entry-top-navigation">
	<a href="http://courageouscaterpillar.com/costa-rica/" class="entry-parent" title=""><i class="x-icon-th" data-x-icon="&#xf00a;"></i></a>

Any pointing in the right direction would be greatly appreciated!
Thanks.

Hi There,

Copying the template files on the same folder on the child theme only works for files inside view folder here:
wp-content\themes\x\framework\views. For functions like that part, just copy the entire function on your child theme functions.php file then edit as necessary. Make sure to copy the complete function because it might result to syntax error if incomplete.

Hope this helps.

1 Like

Awesome. Thanks.

One last question…I have two pages displaying different portfolio categories for selection:

ADVENTURE: http://courageouscaterpillar.com/adventures/
PROFILES: http://courageouscaterpillar.com/profiles/

I’m noticing the portfolio navigation articles (next, previous) only is occurring on adventure portfolio pages, not profile pages.
ADVENTURE:COSTARICA: http://courageouscaterpillar.com/item/costa-rica/
PROFILES:TOMJONSON: http://courageouscaterpillar.com/item/tom-jonson/

However, looking at the source of the profile portfolio page I see the entries are getting generated correctly, just not displayed.

  <div class="x-nav-articles">

          <a href="http://courageouscaterpillar.com/item/yami-parea/" title="" class="prev">
        <i class="x-icon-chevron-left" data-x-icon="&#xf053;"></i>      </a>
    
          <a href="http://courageouscaterpillar.com/item/morelammona/" title="" class="next">
        <i class="x-icon-chevron-right" data-x-icon="&#xf054;"></i>      </a>
    
  </div>

I took out the CSS hiding the portfolio navigation articles for the PROFILES but they still don’t appear. The Adventure page uses the Essential Grid for selection and the PROFILES page using Cornerstone Card elements.

Any idea on the difference?

Hi There,

I have noticed that the custom CSS that hide portfolio navigation on profiles are still there on your child theme style.css file: https://screencast-o-matic.com/watch/cbXreH2Tjm

I don’t see caching so are you sure you have remove it from that place?

Thought of the same thing after sleeping on this one. I removed this from my child theme style.css file. Cleared my browser cache. Quit the browser. Started a new browser session. The navigation articles still aren’t showing up for PROFILES.

Is there somewhere else to look?

Hi there,

It seem that the site is still loading the caches CSS version.

Please try adding this code in the functions.php as well:

function _remove_script_version( $src ){
    $parts = explode( '?ver', $src );
    return $parts[0];
}

add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
1 Like

Thanks. This worked to remove the cache. The navigation items now appear on the PROFILES page. I’m assuming I leave this code in my functions.php file? Will this help with other caching issues or was this fix specific to this individual issue?

Hi,

Yes, you need to leave the code in your child theme’s functions.php file.

It will also help with other caching issues.

Thanks

1 Like