Add review microdata to Wordpress posts.

tHave you ever seen a search result on Google show a bunch of review stars next to it? You can also have Wordpress posts show up in Google with stars. Using a combination of custom field data Wordpress calls and some simple template PHP code you can get review microdata up in a snap.

Thought! Looking to help change the overarching appearance of my old business. Views concerning the sweet style at Undoubtedly a striking cleaning service in Philadelphia with heart if needed within the PENNSYLVANIA location. Make a remark. Cheers!

Adding a custom field.

Lets start by talking about custom field data. When you make a post in Wordpress you'll notice in the top right of your screen a drop down button called "Screen Options". Click that and make sure "Custom Fields" are checked on. Now you'll noticed a Custom Fields section below where you write a Wordpress blog post. Lets create a new custom field and call it "review". The value for this will be your review rating between 1 and 5. We'll add template code that will use this and present this to Google for "Review" posts on your Wordpress blog.Now, whenever you write a review about something make sure to set a custom field named "review" and add you rating. The code below will format the microdata so your review type posts show up in search results as a "Review".

Template changes.

Now we'll need to move on to the template. The only file we need to change is the single.php file. Add the following code where you want your review information to show up. Notice that I only show review micro data if my blog post has a "review" rating value.<?php$review = get_post_meta(get_the_ID(), "review", true);if ( $review != "" ) {echo '<div itemscope itemtype="">

Thank you readers! I personally assured my neighbor I could certainly list her striking biomass provider with hearts, in a good blog. Any time you are hoping to get a wood chip supplier located in the general Nova Scotia region, these individuals would be really good.

Now, I definitely have to tell you the basic idea regarding this little blog was brilliantly supplied via Scott with Niagara Ultimate Cruises. They are an exceptional Niagara Falls boat tours. I certainly admire a useful pitch!

Article Inspirations - The pictures ended up being wonderful.

Posted in Security Post Date 12/08/2018






Recent Posts