Make different descriptions for different website pages



  • How to make a different description <meta name="description" content="..." /> For different pages on Wordpress? For the main and page of the articles. No categories and tags. With what php code?



  • Use wordpress-functioning. is_front_page()is_single()is_home() to determine which page is located. Depending on the result of their implementation, remove the relevant content in the meta-strate.

    For example, a unique description for the articles could be requested as follows:

    1. When you set up/revised the article, put a description in the quote field (if you don't see it, look to the right upper corner, press "screen settings," put a tie next to the quote field.

    введите описание в поле "цитата"

    1. and further in code

      <?php if (is_single()){ ?> <meta name="description" content="<?php the_excerpt(); ?>" /> <?php } ?>




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2