Category title section missing from blog posts

I am using Pro version 1.2.7 on WordPress 4.9.4 running Pro – Child Theme
My stack is ETHOS
I am also using a Pro header.

my URL: http://stripts.perrywebcreations.com/blog

My problem is, I want my category titles to show in the blog.
When you use a Pro header, it cancels out the category title (h.landmark)

How can I show what Category your in when you view a blog post?

I already looked at this support ticket https://theme.co/apex/forum/t/ethos-portfolio-page-title-missing/20524 but it did not work because it only added the category title on category pages, but not on the individual blog posts.

To clarify,

  • When I click on a blog post that falls under the category “PRESS” I want it to say PRESS at the top.
  • When I click on a blog post that falls under the category “AWARDS” I want it to say AWARDS at the top.
  • When I click on a blog post that falls under the category “SPECIALS” I want it to say SPECIALS at the top.
  • etc.

Please help!

Hello @bperry420,

Thanks for writing in! :slight_smile:

How about we try this? Please add this code to your child theme’s functions.php.

add_shortcode('awesome_landmark','awesome_landmark');

function awesome_landmark ( $atts ) {

	ob_start();

	$disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true );
	$disable_filters    = get_post_meta( get_the_ID(), '_x_portfolio_disable_filtering', true );
    $category = get_the_category();
    $firstCategory = $category[0]->cat_name;
	?>

	<?php if ( is_home() && x_get_option( 'x_integrity_blog_header_enable' ) == '1' ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_blog_title' ); ?></h1>
			<p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_blog_subtitle' ); ?></span></p>
		</header>

	<?php elseif ( is_single() ) : ?>
         
		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo get_the_title(); ?></span><span style="padding: 0 20px;">/</span><span><?php echo firstCategory; ?></span></h1>
		</header>

	<?php elseif ( is_search() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "Below you'll see everything we could locate for your search of ", '__x__' ); echo '<strong>&ldquo;'; the_search_query(); echo '&rdquo;</strong>'; ?></span></p>
		</header>

	<?php elseif ( is_category() || x_is_portfolio_category() ) : ?>

		<?php

		$meta     = x_get_taxonomy_meta();
		$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Category Archive', '__x__' );
		$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been categorized as ", '__x__' ) . '<strong>&ldquo;' . single_cat_title( '', false ) . '&rdquo;</strong>';

		?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo $title ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p>
		</header>

	<?php elseif ( x_is_product_category() ) : ?>

		<?php

		$meta     = x_get_taxonomy_meta();
		$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Category Archive', '__x__' );
		$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been categorized as ", '__x__' ) . '<strong>&ldquo;' . single_cat_title( '', false ) . '&rdquo;</strong>';

		?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo $title ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p>
		</header>

	<?php elseif ( is_tag() || x_is_portfolio_tag() ) : ?>

		<?php

		$meta     = x_get_taxonomy_meta();
		$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Tag Archive', '__x__' );
		$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been tagged as ", '__x__' ) . '<strong>&ldquo;' . single_tag_title( '', false ) . '&rdquo;</strong>';

		?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p>
		</header>

	<?php elseif ( x_is_product_tag() ) : ?>

		<?php

		$meta     = x_get_taxonomy_meta();
		$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Tag Archive', '__x__' );
		$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been tagged as ", '__x__' ) . '<strong>&ldquo;' . single_tag_title( '', false ) . '&rdquo;</strong>';

		?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p>
		</header>

	<?php elseif ( is_404() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "You blew up the Internet. ", '__x__' ); ?></span></p>
		</header>

	<?php elseif ( is_year() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'Y' ); echo '</strong>'; ?></span></p>
		</header>

	<?php elseif ( is_month() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F, Y' ); echo '</strong>'; ?></span></p>
		</header>

	<?php elseif ( is_day() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F j, Y' ); echo '</strong>'; ?></span></p>
		</header>

	<?php elseif ( x_is_portfolio() ) : ?>
		<?php if ( $disable_page_title != 'on' || $disable_filters != 'on' ) : ?>

			<header class="x-header-landmark x-container max width">
				<?php if ( $disable_page_title != 'on' ) : ?>
					<h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
				<?php endif; ?>
				<?php x_portfolio_filters(); ?>
			</header>

		<?php endif; ?>
	<?php elseif ( x_is_shop() && x_get_option( 'x_integrity_shop_header_enable' ) == '1' ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_shop_title' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_shop_subtitle' ); ?></span></p>
		</header>

	<?php elseif ( x_is_buddypress() ) : ?>
		<?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>

			<header class="x-header-landmark x-container max width">
				<h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
				<p class="p-landmark-sub"><span><?php echo x_buddypress_get_the_subtitle(); ?></span></p>
			</header>

		<?php endif; ?>
	<?php endif;

	return ob_get_clean();

} 

Then add the shortcode below into a Text Element of your header.
[awesome_landmark]

Hope it helps.

That only fixed part of the problem.

Now the Category title shows on the category page as it should, but each post page is showing the POST TITLE above the post, when it should be showing the CATEGORY TITLE above the post.

see one of my posts here:
http://stripts.perrywebcreations.com/best-of-boston-2015-best-burger

It should say AWARDS above the post image. NOT the post title.

Hello there,

Let us try again. I just edited a typo error.

add_shortcode('awesome_landmark','awesome_landmark');

function awesome_landmark ( $atts ) {

	ob_start();

	$disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true );
	$disable_filters    = get_post_meta( get_the_ID(), '_x_portfolio_disable_filtering', true );
    $category = get_the_category();
    $firstCategory = $category[0]->name;
	?>

	<?php if ( is_home() && x_get_option( 'x_integrity_blog_header_enable' ) == '1' ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_blog_title' ); ?></h1>
			<p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_blog_subtitle' ); ?></span></p>
		</header>

	<?php elseif ( is_single() ) : ?>
         
		<header class="x-header-landmark x-container max width">
                       	<h1 class="h-landmark"><span><?php echo $firstCategory; ?></span></h1>
		</header>

	<?php elseif ( is_search() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "Below you'll see everything we could locate for your search of ", '__x__' ); echo '<strong>&ldquo;'; the_search_query(); echo '&rdquo;</strong>'; ?></span></p>
		</header>

	<?php elseif ( is_category() || x_is_portfolio_category() ) : ?>

		<?php

		$meta     = x_get_taxonomy_meta();
		$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Category Archive', '__x__' );
		$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been categorized as ", '__x__' ) . '<strong>&ldquo;' . single_cat_title( '', false ) . '&rdquo;</strong>';

		?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo $title ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p>
		</header>

	<?php elseif ( x_is_product_category() ) : ?>

		<?php

		$meta     = x_get_taxonomy_meta();
		$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Category Archive', '__x__' );
		$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been categorized as ", '__x__' ) . '<strong>&ldquo;' . single_cat_title( '', false ) . '&rdquo;</strong>';

		?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo $title ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p>
		</header>

	<?php elseif ( is_tag() || x_is_portfolio_tag() ) : ?>

		<?php

		$meta     = x_get_taxonomy_meta();
		$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Tag Archive', '__x__' );
		$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been tagged as ", '__x__' ) . '<strong>&ldquo;' . single_tag_title( '', false ) . '&rdquo;</strong>';

		?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p>
		</header>

	<?php elseif ( x_is_product_tag() ) : ?>

		<?php

		$meta     = x_get_taxonomy_meta();
		$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Tag Archive', '__x__' );
		$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been tagged as ", '__x__' ) . '<strong>&ldquo;' . single_tag_title( '', false ) . '&rdquo;</strong>';

		?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p>
		</header>

	<?php elseif ( is_404() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "You blew up the Internet. ", '__x__' ); ?></span></p>
		</header>

	<?php elseif ( is_year() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'Y' ); echo '</strong>'; ?></span></p>
		</header>

	<?php elseif ( is_month() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F, Y' ); echo '</strong>'; ?></span></p>
		</header>

	<?php elseif ( is_day() ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F j, Y' ); echo '</strong>'; ?></span></p>
		</header>

	<?php elseif ( x_is_portfolio() ) : ?>
		<?php if ( $disable_page_title != 'on' || $disable_filters != 'on' ) : ?>

			<header class="x-header-landmark x-container max width">
				<?php if ( $disable_page_title != 'on' ) : ?>
					<h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
				<?php endif; ?>
				<?php x_portfolio_filters(); ?>
			</header>

		<?php endif; ?>
	<?php elseif ( x_is_shop() && x_get_option( 'x_integrity_shop_header_enable' ) == '1' ) : ?>

		<header class="x-header-landmark x-container max width">
			<h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_shop_title' ); ?></span></h1>
			<p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_shop_subtitle' ); ?></span></p>
		</header>

	<?php elseif ( x_is_buddypress() ) : ?>
		<?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>

			<header class="x-header-landmark x-container max width">
				<h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
				<p class="p-landmark-sub"><span><?php echo x_buddypress_get_the_subtitle(); ?></span></p>
			</header>

		<?php endif; ?>
	<?php endif;

	return ob_get_clean();

}

Thank you, that took care of it. Please let Themeco know that Category titles at the top of blog posts is a common need for a lot of people. It would be nice to have the option in the Ethos stack. Thanks again!

1 Like

Hi There,

We respect all feedback/suggestion by our customer and we will keep this in mind and our developer team will look on to it.

Thanks

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.