WordPress Each theme, basically did not optimize, the search engine is not friendly, nonsense not to say, stationmaster effect NET is through this method to optimize, hope to be helpful to you.
WordPress Each theme, basically did not optimize, the search engine is not friendly, nonsense not to say, stationmaster effect NET is through this method to optimize, hope to be helpful to you.
1. The title optimizes the code, you oneself according to own site makes the corresponding modification:
<title><?php if (Is_home ()) {bloginfo (' name '); echo "-Provides comprehensive web effects and advertising code, Web pages commonly used JS effects and scripts.";} elseif (Is_category ( ) {single_cat_title (); echo "–"; Bloginfo (' name '); } elseif (Is_single () is_page ()) {single_post_title (); echo "–"; $category = Get_the_category (); Echo $category [0]->cat_name; echo "–"; Bloginfo (' name '); } elseif (Is_search ()) {bloginfo (' name '); echo "Search results:"; echo Wp_specialchars ($s); else {Wp_title (", true);}? ></title>
2. Homepage, category page, article page add keyword keywords and description description:
<?php if (Is_home ()) {$keywords = "web effects, advertising code, JS effects, JS Special effects code, scripts, special effects, JS script, JavaScript effects, script code, js,javascript"; $ Description= "The most comprehensive web page special effects code and JS script, Web page necessary JS special effects, including commonly used image effects, date effects, text effects, window effects, layer effects, form effects, color effects, mouse effects, etc., but also provide a large number of high-quality advertising code." ”; } ElseIf (Is_single ()) {
$keywords = ""; $tags = Wp_get_post_tags ($post->id); foreach ($tags as $tag) {$keywords = $keywords. $tag->name. ” “; $description = $post->post_excerpt;} ElseIf (Is_category (3)) {$keywords = "navigation menu, hidden, Scrolling, tabs, pop-up, left, transparent"; $description = "navigation menu commonly used special effects, such as hidden effects, fade, pop-up effects and so on. ”; } ElseIf (Is_category (4)) {$keywords = "image effects, picture switching, scrolling, picture display, zooming, fading, floating, transparent, dragging"; $description = "Web page common image effects, the site is often a picture switch, picture display, Picture scrolling, picture floating, picture zooming in and out, fading and other effects. ”; } ElseIf (Is_category (5)) {$keywords = "date effect, timing, countdown, clock, calendar, get, perpetual calendar, pop-up"; $description = "very practical JS date effect, such as Web clock script, timing, Countdown script, text box date selection, and so on. ”; } ElseIf (Is_category (6)) {$keywords = "color effects, gradients, background colors, color, discoloration, flashing"; $description = "web color effects, JS control background color or discoloration and other web effects are all collected here. ”; } ElseIf (Is_category (7)) {$keywords = "text effects, timing, flashing, double-clicking, pop-up, scrolling"; $description = "Collect the most comprehensive text effects, such as text scrolling, timed display, flashing effects, double clicks, pop-up effects, scrolling effects." ”; } ElseIf (Is_category (8)) {$keywords = "form button, text box, limit, button, input box, list box, select All, reverse Select, copy, Associate menu, Pull-down menu, jump, linkage menu, timer, pop-up, get"; $description = " Very comprehensive Form button special effects, commonly used effects have a full selection, reverse, js get parameter values, linkage menu and other web effects. ”; } ElseIf (Is_category (9)) {$keywords = "window effect, popup, pop-up, expand, rightLower corner, hint layer, frame, timer, prompt window "; $description = "Web window Special effect Kam sac, webmaster commonly used in the lower right corner window, pop-up windows, hint layer, frame and other web effects." ”; } ElseIf (is_category) {$keywords = "table layer, hint layer, alternate color, scroll bar, cell, drag, hide, shrink, eject"; $description = "page table layer effects congregate, alternate colors, drag tables, hidden layers , pop-up layers and other common web effects. ”; } ElseIf (is_category) {$keywords = "mouse effects, click, disable, right button, mouse sensor, follow"; $description = "Mouse effect is also a very common kind of web effects, many Web sites with the disabled right button, The mouse sensor is a good example. ”; } ElseIf (is_category) {$keywords = "tab, jump, match, prohibit, get, checkbox, generate"; $description = "Web page comprehensive effects, a more complex web effects, often combined with several special effects to achieve the final effect. ”; } ElseIf (is_category) {$keywords = "Advertising code, picture switching, top right corner, picture display, couplet, picture toggle, telescopic"; $description = "Collect the most comprehensive advertising code, the site is commonly used is the picture switching effect, There are various types of advertising code. ”; } ElseIf (is_category) {$keywords = "stationmaster news, Stationmaster makes money, the website makes money, the web develops, the website runs, the website is profitable"; $description = "stationmaster often read article, consider how to run a website, achieve profit purpose." ”; } ? >
<meta content= "<?php echo $keywords;?>"/>
<meta content= "<?php echo $description;?>"/>
where Is_category (4) in the middle of the number is the ID of each category, does not look at the database can revert to the default link, and then the mouse through the navigation, see the lower left corner? Cat=xxx, the following number is the category ID.
Article title can be so set: article name "category name" site name. How do I get the category name? The above code has, is this paragraph: <?php $category = Get_the_category (); Echo $category [0]->cat_name;?>
The above are in the subject directory of the header.php inside modify, each theme template name should be the same bar, not the same you find the head of the file.
This article Sky (www.zzjs.net) original editor, please observe the industry rules, reprint reserved copyright.