Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #884551
    NEWBIE_USER_PHOENIX
    Participant

    Hi there again –

    Example:
    http://www.speedynets.com/why-choose-speedy-networks/

    I have used only H2 tags throughout the site.
    No H1.
    But need one and only one per page for SEO as tools are telling me.

    Ideas ?

    I do use a child and can do PHP and functions if that is best.

    Thanks !
    SpeedyNetworks.us

    #885359
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! To resolve this issue, since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    // Add h1 to pages 
    // =============================================================================
    add_filter( 'the_content', 'custom_author_code');
    function custom_author_code($content) {
       if (is_page()) {
          return $content . 
          '<div class="hatom-extra hidden" style="display: none;"><h1 class="title">'. get_the_title() .'</h1> <p>Modified last: <span class="updated"> '. get_the_modified_time('F jS, Y') .'</span> by <span class="author vcard"><span class="fn">'. get_the_author() .'</span></p></div>' ;
       } else {
          return $content;
       }
    }
    // =============================================================================

    Hope this helps. Kindly let us know.

    #891867
    NEWBIE_USER_PHOENIX
    Participant

    One minor glitch.

    Now the FRONT page has two H1 so SEO dinged.

    From experimenting appears first is from :
    ADMIN > SETTINGS > GENERAL > SITE TITLE

    If delete then picks up for H1 :
    ADMIN > SETTINGS > GENERAL > TAGLINE

    How do I have on all pages but front ?

    Thanks !

    #892800
    Rue Nel
    Moderator

    Hello There,

    Please have the code updated and use this instead:

    // Add h1 to pages 
    // =============================================================================
    add_filter( 'the_content', 'custom_author_code');
    function custom_author_code($content) {
       if ( is_page() && !is_front_page() ) {
          return $content . 
          '<div class="hatom-extra hidden" style="display: none;"><h1 class="title">'. get_the_title() .'</h1> <p>Modified last: <span class="updated"> '. get_the_modified_time('F jS, Y') .'</span> by <span class="author vcard"><span class="fn">'. get_the_author() .'</span></p></div>' ;
       } else {
          return $content;
       }
    }
    // =============================================================================

    Please let us know if this works out for you.

    #894007
    NEWBIE_USER_PHOENIX
    Participant

    Works as always!
    You can see at :
    speedynetworks.us
    Thanks Heroes !

    #894858
    Darshana
    Moderator

    Glad we were able to help 🙂

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