Joke Collection Website - Talk about mood - How to set keyword descriptions for wordpress themes

How to set keyword descriptions for wordpress themes

(1) Use WORDPRESS keywords to set plug-ins. This method is the most convenient and simple. First, search for platinum in the WORDPRESS installation plug-in.

Search engine optimization package or all in one search engine optimization.

Package one of the plug-ins, find it and click Install. After the installation is completed, it is time to start the plug-in. After starting, open the plug-in under WORDPRESS settings and enter the title or description you want to add in the corresponding item of the plug-in. . . . They can set the title, description, keywords and other items of each article page.

(2) Use JS code. This method is a bit complicated and recommended to people who know JS programming.

"Edit" option, enter the topic editing option; This step is too simple, so I won't take a screenshot.

Click the "header.php" template in the template:

find

The following is a quote:

& lt? php if (is_home()){

$ description = "- Fill in the description of your own website here-";

$ keywords = "- keywords of your website-"; }//Determine whether it is a home page, and if it is, specify keywords and descriptions. Please note that change the keywords and decisions above to your own.

Ersev

(is_single()){

if($ post-post _ extract){

$ description = $ post-post _ extract; } else if(function _ exists(' WP _ thumbnails _ extract '){

$description =

WP _ thumbnails _ extract($ post-post _ content,

True); } else { $ description = $ post-post _ title; } $ keywords =

$ tags = WP _ get _ post _ tags($ post-ID);

foreach ($tags as $tag ) {

$keywords = $keywords。 "," .$ tag-name; }}//Determine whether it is an article page. If so, the article label is set as keyword, and the summary (which can be set in the background, so I won't explain it here) is set as description. If there is no summary, the title is set to description.

elseif(is_category()){

$ description = category _ description(); }//Judge whether it is a classified page.

Echo "& ltmeta name=\" Description \ "

content=\"$description\" /

& ltmeta name = \ " keywords \ " content = \ " $ keywords \ "/"; ? //This step is to call the above function.

After setting, click Update and Save to use.