I have two different pages displaying portfolio items. Each displays portfolio items of a different Portfolio Category. One displays the “Adventure” Portfolio Category. The other displays the “Profile” Portfolio Category. For flexibility of page layout, neither one of these pages uses the default Portfolio Layout Template. Therefore, when an individual portfolio item of the different types is displayed, I’d like to set the entry-top-navigation (nine black squares icon anchor) to the appropriate parent page.
I’ve place the following framework\functions\ethos.php function within my child-theme functions.php file:
// 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=""></i></a>
<?php x_entry_navigation(); ?>
</div>
<?php
}
endif;
I’d like to update the $link value based on the current portfolio’s category. I’m trying something like the following:
if ( x_is_portfolio_item() ) {
/* CC——————————————-------------------------------- */
if (in_category(‘Adventure’)) {
$link = ‘http://courageouscaterpillar.com/adventures/‘;}
elseif (in_category(‘Profile’)) {
$link = ‘http://courageouscaterpillar.com/profiles/‘;}
else {
$link = x_get_parent_portfolio_link();}
/* CC———————————————————------———— */
} elseif ( x_is_product() ) {
$link = x_get_shop_link();
}
I don’t believe I’m setting the STRING $link values or identifying the portfolio categories correctly. Any point in the right direction would be greatly appreciated.
Thanks!