-
AuthorPosts
-
February 13, 2015 at 7:48 pm #395981
Hi Guys,
It looks like there’s a bug on Portfolio Items and Posts Category pages, whereby the title of the most recent portfolio item or post is displaying in the Title Bar.
Examples for Portfolio Items:
http://www.crude.com/media_entries/oil-and-gas-investing-report/
http://www.crude.com/media_entries/educational-videos/
http://www.crude.com/media_entries/infographics/And for Post categories:
http://www.crude.com/category/company-news/
http://www.crude.com/category/blog/
http://www.crude.com/category/in-the-press/Is it possible to have the Title Bar display the Category name instead of the most recent post title?
Thank you!
Dave
February 15, 2015 at 10:01 am #396303Hi atrixdave!
Thank you for using Enfold.
We can’t reproduce the issue no our installation. Make sure that you have the latest version of the theme, 3.0.8. Did you add any filter hooks to the functions.php file called avf_title_args?
Best regards,
IsmaelFebruary 17, 2015 at 6:13 am #397247Hi Ismael,
Yes I have these two in my functions.php file:
//* CHANGE HEADER ON TITLE BAR TO H4 *//
add_filter( ‘avf_title_args’, ‘enfold_customization_change_title_heading’ );
function enfold_customization_change_title_heading( $args ) {
$args[‘heading’] = ‘h4’;
return $args;
}//* DISPLAY PORTFOLIO CATEGORY ON TITLE BAR *//
add_filter(‘avf_title_args’, ‘avf_portfolio_title_args’, 10, 1);
function avf_portfolio_title_args($args) {$title = get_the_title($id);
if(is_singular(‘portfolio’)) {
$terms = get_the_terms( $id, ‘portfolio_entries’ );
}elseif(is_singular(‘post’)){
$terms = get_the_terms( $id, ‘category’ );
}if(is_singular(array(‘portfolio’, ‘post’))) {
$portfoliocat = array();
foreach ( $terms as $term ) {
$portfoliocat[] = $term->name;
}
$args[‘title’] = $portfoliocat[0];
} else {
$args[‘title’] = $title;
}return $args;
}February 18, 2015 at 12:36 pm #398051Hi!
On second function, look for this line:
$title = get_the_title($id);
Move it below this line:
if(is_singular(‘portfolio’)) {
Best regards,
IsmaelFebruary 23, 2015 at 10:44 pm #401049Thank you Ismael, but it looks like it removed the title completely now. Any ideas how to get the Category title to display in the title bar?
February 23, 2015 at 10:46 pm #401051PS – I switched it back because all headers lost their titles
February 25, 2015 at 12:05 pm #401978Hey!
Please give us an access to the dashboard. We would like to check it.
Cheers!
IsmaelFebruary 25, 2015 at 7:29 pm #402301This reply has been marked as private.March 1, 2015 at 5:11 pm #404100Hi!
I forgot to tell you that by default, it should show the category name. Please remove the avf_title_args filter on functions.php.
Regards,
IsmaelMarch 2, 2015 at 7:04 pm #404709I think I understand why this is a unique issue to me. I forgot that I had added that filter code into my functions.php file, so that the category of a single portfolio page would display on the title bar. In turn, it also made the most recent portfolio item title display on the CATEGORY archive pages.
Does that make sense?
Is there any way to make it so that the category pages show “Archive for: [Category]” in the title bar, and the individual portfolio item title bar displays the portfolio category?
March 3, 2015 at 7:30 am #404964Hi!
Try to replace the code with this:
add_filter('avf_title_args', 'avf_portfolio_title_args', 10, 1); function avf_portfolio_title_args($args) { if(is_single()) $title = get_the_title($id); if(is_singular('portfolio') && is_single()) { $terms = get_the_terms( $id, 'portfolio_entries' ); }elseif(is_singular('post')){ $terms = get_the_terms( $id, 'category' ); } if(is_singular(array('portfolio', 'post')) && is_single()) { $portfoliocat = array(); foreach ( $terms as $term ) { $portfoliocat[] = $term->name; } $args['title'] = $portfoliocat[0]; } else { $args['title'] = $title; } return $args; }
Regards,
IsmaelMarch 3, 2015 at 9:11 pm #405408This worked, but now the title bars on regular pages are blank:
March 4, 2015 at 6:45 am #405571Hi!
Oh. Sorry about that. This should work:
add_filter('avf_title_args', 'avf_portfolio_title_args', 10, 1); function avf_portfolio_title_args($args) { $title = get_the_title($id); if(is_singular('portfolio') && is_single()) { $terms = get_the_terms( $id, 'portfolio_entries' ); }elseif(is_singular('post')){ $terms = get_the_terms( $id, 'category' ); } if(is_singular(array('portfolio', 'post')) && is_single()) { $portfoliocat = array(); foreach ( $terms as $term ) { $portfoliocat[] = $term->name; } $args['title'] = $portfoliocat[0]; } else { $args['title'] = $title; } return $args; }
Cheers!
IsmaelMarch 4, 2015 at 7:15 am #405577Woohoo awesome thank you Ismael!!! Once again amazing support! You guys are the best
March 4, 2015 at 10:06 am #405652 -
AuthorPosts
- The topic ‘Bug on Media Entries Page’ is closed to new replies.