Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 772405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:47:52+00:00 2026-05-14T18:47:52+00:00

Right now the header has a bit of code in it that queries the

  • 0

Right now the header has a bit of code in it that queries the section name and then uses that section name as the h1 title in the page. It works fine. However, I want to selectively break that operation in certain categories and give myself the ability to manually enter the h1 title for a given section. Here’s what I’m struggling with: how can I maintain the automatic query and title selection in most instances, but selectively break it in a given category (the ‘blog’ category, for starters)?

Thanks for taking a look, I appreciate your help!

Here’s the code that drives the existing function (it’s the get_the_section_name part):

    <?php if(!is_home()){?>
    <div class="section <?php echo get_the_section_name();?>">
        <?php 
        $sectitle = get_the_section_name();
        $sectitle = str_ireplace("-"," ",$sectitle);
        echo '<h1>' . $sectitle . '</h1>';?>

        <p class="breadcrumbs">
            <?php
            if(function_exists('bcn_display'))
            {
                bcn_display();
            }
            ?>
        </p>
    </div>
    <div class="columns">       
    <?php } ?>

Here’s a page that shows what it looks like displayed (see the title in the blue graphic underneath the main nav near the top of the page): http://69.20.59.228/category/blog/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:47:53+00:00Added an answer on May 14, 2026 at 6:47 pm

    Insert following code before line

    echo '<h1>' . $sectitle . '</h1>';?>
    

    Simply add more elements to $special_categories array

    $special_categories = array(
        "blog" => "Special blog title",
        "other category" => "Another special category title",
    );
    
    if (array_key_exists($sectitle, $special_categories)) {
        $sectitle = $special_categories[$sectitle];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my core web-app code in the header right now in a tag
Right now, the label for my Activity has the name of the current Activity.
Right now, I've just some code which fetches the picture from the URL directly.
Right now I have a script that will get the last five files in
Right now I have a function, in a class that is used to listen
As of right now I am trying to create an ASP.NET page which will
I am trying to create a JTable that has a row header that looks
I want to construct a div that has a header with background like that
Right now I am using base64 to control who has access to images on
I right now have a problem that is rather confusing to me: I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.