Support » Plugin: Secondary Title » Plugin messes up comments title in Astra theme

  • Hello,

    I love this plugin. But it is causing issues with a new theme I’m using called Astra.

    It is adding the “title format” to the comments title of the page.

    Please see screenshot:

    I am not sure why this is happening and how to resolve it.

    Thank you for your attention in advance.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter polaatx


    Hello, I think a solution is to add your code to header.php so that I can turn off Auto Show.

    Could you please tell me what is the full code I should add to header.php? I read your documentation but could not figure it out. Sorry I’m a newbie.

    Here’s what my header.php looks like:

     * The header for Astra Theme.
     * This is the template that displays all of the <head> section and everything up until <div id="content">
     * @link
     * @package Astra
     * @since 1.0.0
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    ?><!DOCTYPE html>
    <?php astra_html_before(); ?>
    <html <?php language_attributes(); ?>>
    <?php astra_head_top(); ?>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="">
    <?php wp_head(); ?>
    <?php astra_head_bottom(); ?>
    <body <?php astra_schema_body(); ?> <?php body_class(); ?>>
    <?php astra_body_top(); ?>
    <?php wp_body_open(); ?>
    	class="skip-link screen-reader-text"
    	title="<?php echo esc_html( astra_default_strings( 'string-header-skip-link', false ) ); ?>">
    		<?php echo esc_html( astra_default_strings( 'string-header-skip-link', false ) ); ?>
    	echo astra_attr(
    			'id'    => 'page',
    			'class' => 'hfeed site',
    	<div id="content" class="site-content">
    		<div class="ast-container">
    		<?php astra_content_top(); ?>
    Plugin Author thaikolja


    Hi @polaatx,

    The easiest way to hide/display the secondary title on specific pages is very easily done via CSS.

    1. Go to the affected page.
    2. In your admin bar on top of the screen, click “Customize”
    3. Below, open “Custom CSS”

    Here, we can now make up our rules. However, this only works if we give the secondary an HTML class or ID – otherwise we can’t find it in CSS. So, let’s do that.

    1. Go to Secondary Title’s settings page
    2. Make sure “Auto show” is “On”
    3. In “Title format”: Make up your format and wrap the secondary title in a span just like in this example:

    <strong>%title%</strong>: <span class="secondary-title">%secondary_title%

    We now have the class .secondary-title and can now control where it shows up where it doesn’t.

    Since we want it to show up on most pages, we only have to navigate to one of the affected pages and find the <body>. This element has a class with many identifying information, like “home”, or “single”, or “password-protected”.

    If we don’t want to display the secondary title on single post pages, follow the instructions above and use this in your Custom CSS:

    .singular .secondary-title {
       display: block;

    P.S.: Use Google Chrome’s inspector tool to see if an element has the right class, like here:

    Check the classes

    Again, in short:

    • Do not touch the theme (yet)
    • turn “Auto show” on and wrap the secondary title into a <span>-Tag.
    • Give the tag a class, i.e. <span class="secondary-title">
    • Find out a unique class from the pages’ <body> classes
    • Use display: none; in CSS to hide it. You might have to use !important.
    Thread Starter polaatx


    Hello @thaikolja

    Thanks for your reply. I think I need to explain more what my issue is. I am not trying to control on which pages secondary title appears.

    My issue is that in my Astra theme, secondary title is appearing in BOTH the header (which is what I want) and also in the COMMENTS section title. It is inserting raw html right next to the comments title. See what I mean:

    So your solution to block secondary title using css would not help because then it would also block secondary title from the header too.

    Do you know how I can stop it from inserting this raw html into the comments section title?

    This is one of the affected pages: It does this to EVERY comments section title of EVERY post when there is a comment for that page.

    Plugin Author thaikolja


    Hi @polaatx,

    I kind of have to tip-toe here. On one side, I’d really like to help you out quickly, but forum guidelines forbid me.

    A huge help would be if I had access to your website – no, dear forum mods, not that access – like the theme directories in use. Please send the files .zipped to kolja.nolte @, and I’ll have a look at how you can solve this through my instructions.

    • This reply was modified 8 months, 1 week ago by thaikolja.

    Not sure how this ties into my thread that was closed. I want Secondary Title to appear in single posts. I don’t need it in the breadcrumbs.

    Plugin Author thaikolja


    My hands are tied behind my back. There’s only so much support a developer can give without seeing the actual code. Which you still haven’t sent to me.

    Thread Starter polaatx


    @thaikolja thanks so much for your attention.

    I emailed my theme files to the email you provided.

    I await your reply.

    I am having the same issue in the GeneratePress theme. I’ll see if I can figure out how to email you what you need, too.

    Plugin Author thaikolja


    Hi @polaatx,

    Could you explain how I can reproduce this issue? Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Plugin messes up comments title in Astra theme’ is closed to new replies.