{"id":392,"date":"2011-05-27T13:21:30","date_gmt":"2011-05-27T13:21:30","guid":{"rendered":"http:\/\/wp4design.com\/?p=392"},"modified":"2012-02-26T15:44:36","modified_gmt":"2012-02-26T14:44:36","slug":"basics-seo-for-wordpress","status":"publish","type":"post","link":"http:\/\/4design.xyz\/wordpress-basics\/basics-seo-for-wordpress","title":{"rendered":"Basics SEO for WordPress"},"content":{"rendered":"<p>A Basics SEO for WordPress should make that the content you publish don&#8217;t vanish in the wwwild&#8230; so let&#8217;s garnish some meta tags for diner. Let&#8217;s deal\u00a0first with the\u00a0title tag\u00a0and\u00a0then\u00a0see\u00a0what\u00a0the description\u00a0in the\u00a0belly.<!--more--><\/p>\n<h1>Title Tag<\/h1>\n<pre>\/*\n* Print the &lt;title&gt; tag based on what is being viewed.\n*\/\nif ( ! function_exists( 'basics_title' ) ) :\n    function basics_title() {\n        global $page, $paged;\n        wp_title( '|', true, 'right' );\n        \/\/ Add the blog name.\n        bloginfo( 'name' );\n        \/\/ Add the blog description for the home\/front page.\n        $site_description = get_bloginfo( 'description', 'display' );\n        if ( $site_description &amp;&amp; ( is_home() || is_front_page() ) )\n            echo \" | $site_description\";\n        \/\/ Add a page number if necessary:\n        if ( $paged &gt;= 2 || $page &gt;= 2 )\n            echo ' | ' . sprintf( __( 'Page %s', 'basics' ), max( $paged, $page ) );\n    }\nendif;<\/pre>\n<p>This function called in the <em>header.php<\/em> file is supposed to print le blog&#8217;s name and the blog&#8217;s description when displaying de home page, like this :<\/p>\n<pre>&lt;title&gt;WordPress Basics | A Hard Rock-solid Theme based on HTML5 Boilerplate \u00abFor Those About to Rock\u00bb with WordPress&lt;\/title&gt;<\/pre>\n<p>When we are displaying a single page, the title tag is garnished with the title of the post, following by the blog&#8217;s name :<\/p>\n<pre>&lt;title&gt;Using the Basics grid | WordPress Basics&lt;\/title&gt;<\/pre>\n<h1>Description Tag<\/h1>\n<p>Like the Title Meta Tag, the description one need to present two faces: one when come the home page, and another when a single page shows\u00a0the\u00a0tip\u00a0of his\u00a0nose.<\/p>\n<pre>\/*\n* Print the &lt;meta description&gt; of the web page\n*\/\nif ( ! function_exists( 'basics_description' ) ) :\n    function basics_description() {\n        global $post;\n        if ( is_home() || is_front_page() ) {\n            $description = get_bloginfo( 'description', 'display' );\n        } else if ( '' !== $post-&gt;post_excerpt ) {\n            $basics_description = strip_tags( $post-&gt;post_excerpt );\n        } else {\n            $description = wp_html_excerpt( $post-&gt;post_content, 200 );\n        }\n    return $description;\n    }\nendif;<\/pre>\n<p>According to the code above, the meta description will be filled with the standard description you gave when you installed WordPress (The Slogan). Otherwise, there are two other solutions: one path is to fill this tag with the <em>post_excerpt()<\/em> when available, the other is to give the description the 200 firsts words founded in the page. And Voil\u00e0 !<\/p>\n<p>The last way you may prefer, is not to fill the description tag at all: Google would find its way one way or another (Blondie&#8217;s style) \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Basics SEO for WordPress should make that the content you publish don&#8217;t vanish in the wwwild&#8230; so let&#8217;s garnish some meta tags for diner. Let&#8217;s deal\u00a0first with the\u00a0title tag\u00a0and\u00a0then\u00a0see\u00a0what\u00a0the description\u00a0in the\u00a0belly.<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[62,65,101,129,131,144],"_links":{"self":[{"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/posts\/392"}],"collection":[{"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/comments?post=392"}],"version-history":[{"count":0,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/posts\/392\/revisions"}],"wp:attachment":[{"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/media?parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/categories?post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/tags?post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}