-
AuthorPosts
-
December 1, 2016 at 6:16 pm #719366
Hello,
The breadcrumb container at the top of portfolio entries currently pulls the item category as well as the designated ‘breadcrumb parent page’ that has been selected via the page editor dropdown. I would only like this breadcrumb parent page to appear. How do I turn off the crumbtrail from viewing categories?
Thanks,
KristenDecember 5, 2016 at 9:15 pm #720687Hey Kristen,
Please add following code to Functions.php file in Appearance > Editor
add_filter( 'avia_breadcrumbs_args', 'avia_breadcrumbs_args_mod', 10, 1 ); function avia_breadcrumbs_args_mod( $args ) { if(is_single()){ $args['show_categories'] = false; $args['show_posts_page'] = false; } return $args; }
If that does not help, please post a screenshot showing the changes you would like to make. You can upload your screenshots on imgur.com or Dropbox public folder and post the links here
Best regards,
YigitDecember 9, 2016 at 11:31 pm #722633This doesn’t seem to work right.
I’ve decided that maybe the crumbtrail/right content should just be hidden; I’d like the place of the current page title to simply be a link.
On this page:Where you have the page title”Single Portfolio: 2/3 Slider”, I would like this to be a page link. But. I need to set it up so if it is a standard portfolio item, it will link to /work/, and if it is a portfolio item in the category “team”, it will link to /who-we-are/.
Thanks.
December 14, 2016 at 3:14 am #724064Hi,
Please try adding following code to Functions.php file in Appearance > Editor
add_filter('avf_title_args', 'fix_single_portfolio_title', 10, 2); function fix_single_portfolio_title($args,$id) { if (is_singular('portfolio') && in_category('team')) { $args['link'] = get_home_url() ."/who-we-are/"; } elseif(is_singular('portfolio') && !in_category('team')){ $args['link'] = get_home_url() ."/work/"; } return $args; }
Best regards,
YigitDecember 14, 2016 at 5:37 am #724091Thanks, Yigit. It’s very close… half of it is working. With a few modifications, I was able to link the portfolio items back to the Work landing page. However, the Team category items are using the code for work. Probably because the && !in_category(”) was removed… however I can’t set it to just one category because the portfolio items span many categories. Is there an if/then statement if it is NOT in the category ‘team’?
Here’s what I used:
add_filter('avf_title_args', 'fix_single_portfolio_title', 10, 2); function fix_single_portfolio_title($args,$id) { if (is_singular('portfolio')){ $args['link'] = get_home_url() ."/work/"; $args['title'] = "Work"; } elseif(is_singular('portfolio') && !in_category('team')){ $args['link'] = get_home_url() ."/who-we-are/"; $args['title'] = "Who We Are"; } return $args; }
I’m thinking if I can add something into this calling all other categories other than ‘team’, it will work.
if (is_singular('portfolio')){
Thanks so much for your help!- This reply was modified 8 years ago by kristenangel.
December 14, 2016 at 2:55 pm #724285Hi,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
Login credentials include:
- The URL to the login screen.
- A valid username (with full administration capabilities).
- As well as a password for that username.
- permission to deactivate plugins if necessary.
Best regards,
YigitDecember 14, 2016 at 4:27 pm #724354Sure – login info below.
December 15, 2016 at 11:12 pm #725069*bump*
December 16, 2016 at 3:44 am #725139Hi,
I do not think it will be possible this way. Will you be adding more posts that has Team category? I am thinking about a different approach
Best regards,
YigitDecember 16, 2016 at 4:41 am #725145No, we won’t be adding more posts with the team category.
In order to get posts to have the “What we know” page title, I created a copy of single.php in my child theme and added this under the get_header() call:
$title = __('What We Know', 'avia_framework'); //default blog title - CHANGED $t_link = home_url('/what-we-know'); $t_sub = ""; if(avia_get_option('frontpage') && $new = avia_get_option('blogpage')) { $title = get_the_title($new); //if the blog is attached to a page use this title $t_link = get_permalink($new); $t_sub = avia_post_meta($new, 'subtitle'); } if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title(array('heading'=>'strong', 'title' => $title, 'link' => $t_link, 'subtitle' => $t_sub));
Maybe there is a way to do this for ‘team’ portfolio items?
December 19, 2016 at 9:40 pm #726300—bump—
December 19, 2016 at 11:12 pm #726321Hi!
Please use the code as following
add_filter('avf_title_args', 'fix_single_portfolio_title', 10, 2); function fix_single_portfolio_title($args,$id) { if(is_singular('portfolio') && !is_single(array(7854,46))){ $args['link'] = get_home_url() ."/work/"; } elseif(is_singular('portfolio') && is_single(array(7854,46))) { $args['link'] = get_home_url() ."/who-we-are/"; } return $args; }
7854 and 46 are post ID’s. Please replace it with the ID’s of posts that are in “team” category
Regards,
YigitDecember 19, 2016 at 11:39 pm #726337I’m assuming therre’s a typo in this—are those arrays supposed to both be (7854,46)? They are returning the same result as of now.
I have updated the code to include correct titles:
add_filter('avf_title_args', 'fix_single_portfolio_title', 10, 2); function fix_single_portfolio_title($args,$id) { if(is_singular('portfolio') && !is_single(array(7854,46))){ $args['link'] = get_home_url() ."/work/"; $args['title'] = "Work"; } elseif(is_singular('portfolio') && is_single(array(7854,46))) { $args['link'] = get_home_url() ."/who-we-are/"; $args['title'] = "Who We Are"; } return $args; }
December 19, 2016 at 11:44 pm #726339Hey!
7854 and 46 are the ID’s of my posts on my local installation. You should check the post ID’s of all of your portfolio posts that are in “team” category and replace “7854,46” with “59,60,61” etc. with your post ID’s
Cheers!
YigitDecember 19, 2016 at 11:53 pm #726348That worked!!! Thank you so much!
December 19, 2016 at 11:57 pm #726350 -
AuthorPosts
- The topic ‘Change portfolio breadcrumbs to only display Breadcrumb parent page’ is closed to new replies.