Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1013430
    bperry420
    Participant

    I have 2 different category pages that I am using as custom links in my navbar. One is called Insights and one is called Case Examples.

    My site URLs:
    http://quantumstrat.com/category/case-examples/
    http://quantumstrat.com/category/insights/

    If you go to the category page called “CASE EXAMPLES” and click on a post to go to the index page of that post, the page title says CASE EXAMPLES (as it should) but when you go to the category page called INSIGHTS and click on a post to go to the index page of that post, the page title also says “Case Examples”. (It should say Insights) How do I make the page title match the category name?

    WordPress 4.5.2 running X – Child Theme theme.
    X Version: 4.4.2
    Cornerstone installed Version 1.2.4

    #1013915
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! By default, it will display the blog title which you can set in the customizer, Appearance > Customize > Renew > Blog Options > Blog Title. I am guessing that you want to display the category of the post instead? If that’s the case, you need to edit your _landmark-header.php file in your child theme. Find these lines:

    <?php elseif ( is_home() || is_single() ) : ?>
    	<?php if ( x_is_portfolio_item() ) : ?>
    
    	  <h1 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h1>
    
    	<?php else : ?>
    
    	  <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h1>
    
    	<?php endif; ?>

    And replace it with this:

    <?php elseif ( is_home() || is_single() ) : ?>
        <?php if ( x_is_portfolio_item() ) : ?>
    
          <h1 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h1>
    
        <?php else : ?>
    
          <?php 
            $categories = get_the_category();
    
            if ( ! empty( $categories ) ) {
                echo '<h1 class="h-landmark"><span>' . esc_html( $categories[0]->name ) . '</span></h1>';   
            }
          ?>
        <?php endif; ?>

    Since the categories were order in alphabetical order, only the first category will appear if you have assign the post to two or more category names.

    Please let us know if this works out for you.

    #1013928
    bperry420
    Participant

    I don’t know what you did to my category pages, but now my category page that used to say CASE EXAMPLES now says “Category Archive”
    http://quantumstrat.com/category/case-examples/

    and my other category page called INSIGHTS that used to say INSIGHTS at the top now says “Category Archive”
    http://quantumstrat.com/category/insights/

    Can you please fix?

    #1014079
    Rue Nel
    Moderator

    Hello Again,

    All I did is restore the code back to its original code. I then added the code so that the single category title when you are viewing the single blog post. In your category archive page, it is displaying “Category Archive” because you did not add a category archive title. Simply edit all your categories in Post > Categories and insert the Archive Title. If you dod not want to edit it, it will display “Category Archive” because this is the default value.

    http://prntscr.com/b9d1g2
    http://prnt.sc/b9d170

    Hope this explains the changes I made.

    #1014341
    bperry420
    Participant

    once again you guys are awesome. I actually never used the “archive title” field in the edit category section. I never noticed it before. Thanks again. Your tech support team is top notch.

    #1014360
    Christopher
    Moderator

    You’re most welcome.

  • <script> jQuery(function($){ $("#no-reply-1013430 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>