Site logo

[Support request] Displaying Post Title On Desktop In Header And Before Content On Rest

Home Forums Support [Support request] Displaying Post Title On Desktop In Header And Before Content On Rest

Home Forums Support Displaying Post Title On Desktop In Header And Before Content On Rest

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #2096724
    Elvin
    Staff
    Customer Support

    The goal is for the header element that includes the post date and title to display on BOTH desktop AND mobile. I need it to NOT display on tablet. On tablet I need the post title AND post date to display in the usual WP fashion.

    If this is the case then you may have to NOT use wp_is_mobile() to revert to what previously worked but use only hide-on-tablet for the one you’ve placed inside the Header element.

    But in consideration to SEO as Ying mentioned, you may have to set one of the 2 H1s to H2 or <span>.

    And then for the elements you’ve hooked on Hook element ID 192, consider wrapping them in a DIV element width w/ a specific class so you only have to apply the display: none; for tablet on it to automatically hide both the title and date.

    example:

    <?php 
    	echo '<div class="hide-on-desktop hide-on-mobile">';
    	echo '<h1><center>' . get_the_title() . '</center></h1>';
    	echo '<p><i><center>' . get_the_date() . '</center></i></p>';
    	echo '</div>';
    ?>

    This way, this block only displays on tablet which is inverse of the other element you’ve hook that had only hide-on-tablet.

    #2096737
    Robert

    Bingo! We have lift off! Boy was that a bit of a journey for me!

    I’m perfectly ok with having the post title inside the header element as an h2. Only one h1 set is now showing in the underlying html for all resolutions which is good. I’m just happy someone caught that as I would have not known there were two of them showing up initially!

    Thanks for the help from everyone. Good job as usual!

    #2096744
    Elvin
    Staff
    Customer Support

    No problem. Let us know if you need further help. 😀

Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.