• Resolved garulfo

    (@garulfo)


    Hi,

    I am using the free Virtue theme and I would like not to have the titles at the top of my pages.

    I have not found any option in the theme options to solve the problem. (Did I miss something??)

    I have tried to install the following plugins but the problem remains:
    1. Toggle the title
    2. Title Remover
    3. Hide Page And Post Title
    4. Hide title

    For SEO purposes, I am NOT looking for a solution based on CSS (“display:none” on the class of the title at the top of the pages).
    Therefore, I would “simply” like not to have an automatically added <h1> tag containing the title at the top of the pages.

    What is your recommendation?

    Thank you very much for your support.
    David

Viewing 14 replies - 1 through 14 (of 14 total)
  • hannah

    (@hannahritner)

    Hi David,
    Are you wanting to remove the h1 title sitewide? You would need to use a child theme for this. Are you using one currently?
    https://www.kadencethemes.com/child-themes/

    Hannah

    In your child theme you would add this into the functions.php file:

    remove_action('virtue_page_title_container', 'virtue_page_title', 20);

    Ben

    Thread Starter garulfo

    (@garulfo)

    Hi Hannah & Ben,

    Thank you for your help.

    To answer your questions, Hannah:
    > Are you wanting to remove the h1 title sitewide?
    Yes

    > You would need to use a child theme for this.
    OK

    > Are you using one currently?
    No. It’ll be the first time I create one.

    > https://www.kadencethemes.com/child-themes/
    Great intro, thanks!

    Here is what I did so far:
    1. Created a virtue-child folder under the /wp-content/themes/ folder
    2. Put 3 files into this virtue-child folder (from your link, Hannah): functions.php, screenshot.png, style.css
    Then I modified them.
    The content of style.css is:
    /*
    Theme Name: Virtue Child Theme
    Template: virtue
    Version: 1.0.0
    */

    The content of functions.php is:
    <?php
    remove_action(‘virtue_page_title_container’, ‘virtue_page_title’, 20);
    ?>

    3. Went to my admin and navigated to Appearance > Themes
    4. Activated the child theme
    5. Deleted my caches
    6. Updated one of the pages
    7. Checked if the title was still there

    Unfortunately, the title is still there.

    Did I miss something?

    Thanks again for your support!
    David

    hannah

    (@hannahritner)

    Can you post a link to your site?

    Hannah

    Thread Starter garulfo

    (@garulfo)

    Hi Hannah,
    Thank you for your message.
    As I would prefer the domain name not to be published (in order not to be subsequently indexed by Google), here is a link to it: https://bit.do/eaGN7
    Thanks again for your support,
    David

    Try removing the second “?” in your functions.php. It should look like this:

    <?php
    remove_action(‘virtue_page_title_container’, ‘virtue_page_title’, 20);
    >

    -kevin

    Thread Starter garulfo

    (@garulfo)

    Hi Kevin,
    When I remove the second “?”, the webpage does not load any more.
    At least it proves that the functions.php of the child theme is well taken into account.
    Thanks,
    David

    Sorry, I don’t know why I thought that was wrong. The question mark should definitely be there.

    I’ll send this onto the theme developer so he can take a look.

    -Kevin

    Hey,
    So I shouldn’t have assumed you had worked with a child theme I just did since you seemed to be asking for a code change.

    In a child theme to get hooks and actions to register at the correct time, you need to add all of those in a init hook function.

    So this should be what your functions.php file looks like:

    <?php
    add_action( 'init', 'custom_child_setup');
    function custom_child_setup() {
    // Place all custom hooks here
    remove_action('virtue_page_title_container', 'virtue_page_title', 20);
    }

    Ben

    Thread Starter garulfo

    (@garulfo)

    Hi Ben,

    > you seemed to be asking for a code change
    Well, for whatever is needed and works, actually! ??

    And… Your code works perfectly!
    Thank you Ben & Hannah & Kevin!

    Is there a reason the “hide title” option doesn’t work on the homepage? It works on all other pages except for that one.

    In the Page/Post Settings, I have Show page title by default turned off, yet the page title likes to show up on the homepage despite turning it off, turning it to default, installing an additional plug-in. What gives?

    The page is on coming-soon mode, so I can’t share it here, but I wonder if anyone else is experiencing this.

    hannah

    (@hannahritner)

    Hi @ashleywirthlin,
    Please start a new thread. This one has already been marked as resolved.
    Thanks!

    Hannah

    Yes, home page title is controlled separately in Theme Options> Home Layout by moving it to either the enabled column.

    -Kevin

    Sorry, @hannahritner. Duly noted for next time.

    Thanks, @jx-3p. It was so simple I didn’t even see it!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Remove title from top of the pages’ is closed to new replies.