This topic has 6 replies, 2 voices, and was last updated 8 years by sharmstr.

  • Author
  • #82984
     Stephanus
    Participant

    I’m trying to add a meta description to my home page (which is basically my blog, i.e. under ‘Reading Settings’, I’ve set my front page to display my latest blog posts) but I can’t figure out where/how to do this. As you can see in the attached screenshot, my home page only shows my Site Title and Tagline (which I’ve set under the General Settings).

    Please help.

    Thank you.

    Stephanus

    Attachments:
    You must be logged in to view attached files.
    #83027
     sharmstr
    Moderator

    Most of us use Yoast SEO for that sort of stuff, but you can try this instead…

    COPY CODE
    
    add_action( 'wp_head', 'gen_meta_desc' );
    function gen_meta_desc()
    {
         if ( is_home() ) {
            
             echo "<meta name='description' content='This is my custom description.' />";
         }
    }
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #83200
     Stephanus
    Participant
    This reply has been set as private.
    #83207
     sharmstr
    Moderator

    The code goes in your child theme’s functions.php file.

    Refer to the yoast documentation.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #83216
     Stephanus
    Participant
    This reply has been set as private.
    #84908
     Stephanus
    Participant
    This reply has been set as private.
    #84921
     sharmstr
    Moderator

    Hey Stephanus – As mentioned, its in the Yoast documentation: http://kb.yoast.com/article/146-yoast-wordpress-seo-titles-metas-template-variables

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?