Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #315313

    Hi guys, I have a couple questions on how to do some things on the Portfolio Page title bar. Take a look at this page: http://www.crude.com/media/ogir-texas-electricity-natural-gas/

    1. I would like the Category to display instead of the title on the title bar. For the link above, the title bar (dark gray background) displays the title (OGIR: Texas Electricity to Be Met…), and I’d like it to display the lowest level category (Oil & Gas Investing Report).
    2. The breadcrumb to the right is displaying the wrong category here. Its showing “Infographics” instead of “Podcasts & Radio > Oil & Gas Investing Report”. It should display “You are here: Home / Media / Podcasts / Oil & Gas Investing Report / OGIR: Texas Electricity to Be Met Almost Entirely by Natural Gas”.
    3. Is it possible to hide the display of the post title at the end of the breadcrumb above?

    Thank you guys for all your support!!

    Dave

    #315562

    Hi atrixdave!

    Thank you for using Enfold.

    1.) Try adding this on functions.php:

    function avf_portfolio_title_args($args) { 		
    	$title = get_the_title($id);
    	
    	if(is_singular('portfolio')) {
    	$terms = get_the_terms( $id, 'portfolio_entries' );
    	$portfoliocat = array();
    	foreach ( $terms as $term ) {
    		$portfoliocat[] = $term->name;
    	}	
    	$args['title']    = $portfoliocat[0];	
    	} else {	
    	$args['title']    = $title;
    	}
    	return $args;
    }
    add_filter('avf_title_args', 'avf_portfolio_title_args', 10, 1);
    

    2.) Set the the Media page as parent page of the Podcasts page. See if that changes the breadcrumbs.

    3.) Add this on Quick CSS or custom.css to hide the post title:

    span.trail-end {
    display: none !important;
    }

    Cheers!
    Ismael

    #315653

    Thanks for the reply Ismael.

    1) I added this to functions.php in my child theme and its still showing the portfolio item title instead of the category on the title bar.
    2) This isn’t working.
    3) Hides the post title but also hides the page titles. So for instance if you go to the Podcasts page, it says “You are here: Home /”
    http://www.crude.com/podcasts/. Any way to only hide post titles and not page titles?

    #316728

    Hi!

    For #2, you also need to choose to use manual parent pages on each single portfolio item from the meta box on the right. Otherwise the breadcrumbs use session data to figure out where the user came from when viewing the page. Its the very last one by default labeled “Breadcrumb Hierarchy”.

    #3 – You could do:

    
    .single-portfolio span.trail-end {
    display: none !important;
    }
    

    So that it only effects the single-portfolio page class. Though this is a bit odd in practice as breadcrumbs always show the end as being where the user actually is.

    For #1 I don’t know of any other way if Ismaels snippet isn’t working for you. If its a must-have customization you can look into a freelance developer from somewhere like Envato Studio or Codeable.

    Regards,
    Devin

    #317068

    Thanks Devin! Your solutions for #2 and #3 work. Would be great if you could set a default way for breadcrumbs to be handled vs it being figured out by session.

    As far as #1, yeah I copied and pasted Ismael’s code into functions.php and Im still seeing the portfolio item title there instead of the category…

    #317088

    Hey!

    For #1, try this code instead:

    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' );
    	$portfoliocat = array();
    	foreach ( $terms as $term ) {
    		$portfoliocat[] = $term->name;
    	}	
    	$args['title']    = $portfoliocat[0];	
    	} else {	
    	$args['title']    = $title;
    	}
    	return $args;
    }

    Cheers!
    Josue

    #317122

    Thank you Josue! That did the trick! You guys are awesome

    #317125

    You are welcome, always glad to help :)

    Regards,
    Josue

    #317128

    Ok now I have the same issue for posts :)

    How do I accomplish the same 2 things?

    Take a look at this page: http://www.crude.com/powering-america-premiers-daily-radio-talk-show-devoted-issues-energy/

    1. I would like the Category to display instead of the title on the title bar. For the link above, the title bar (dark gray background) displays the title (“Powering America” Premiers…), and I’d like it to display the lowest level category (In the Press).
    2. How to hide the Post title in the breadcrumb without hidng pages as well?

    #317923

    Hey!

    Try the following:

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

    Cheers!
    Josue

    #318305

    Thanks Josue…unfortunately post pages display as a blank white screen when I use that code on functions.php. Any other ideas?

    #318328

    Hi!

    That code worked on my end, can you check your PHP error log for some insight?

    Cheers!
    Josue

    #320766

    Sorry if this is a dumb question, but how do I do that? Is that enabled by default?

    #320789

    Hi,

    Can you please create me an administrator account? post it here as a private reply.

    Regards,
    Josue

    #323876
    This reply has been marked as private.
    #326261

    Hey!

    It should work now, you needed to remove the old code in child functions.php.

    Best regards,
    Josue

    #326808

    Fixed! Thank you Josue!!!

    #326833

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 18 posts - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.