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

    #396303

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

    #397247

    Hi 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;
    }

    #398051

    Hi!

    On second function, look for this line:

    $title = get_the_title($id);
    

    Move it below this line:

    if(is_singular(‘portfolio’)) {
    

    Best regards,
    Ismael

    #401049

    Thank 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?

    #401051

    PS – I switched it back because all headers lost their titles

    #401978

    Hey!

    Please give us an access to the dashboard. We would like to check it.

    Cheers!
    Ismael

    #402301
    This reply has been marked as private.
    #404100

    Hi!

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

    #404709

    I 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?

    #404964

    Hi!

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

    #405408

    This worked, but now the title bars on regular pages are blank:

    http://www.crude.com/newsroom/

    #405571

    Hi!

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

    #405577

    Woohoo awesome thank you Ismael!!! Once again amazing support! You guys are the best

    #405652

    Hi!

    Glad we could help :)

    Cheers!
    Rikard

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Bug on Media Entries Page’ is closed to new replies.