How to edit schema.org markup of WooCommerce? Especially I am looking to delete the itemprop availability or hide it from Google rich snippets, but I cant find it in the woocommerce files.
I thought it´ll be within theme>woocommerce>single-product> ... But cant find it.
I am also happy with a hook via functions.php if you have any idea.
to change or make your own schema look at woocommerce/content-single-product.php.
there are all hooks listed for a snippets in this file and I think you need a
WC_Structured_Data::generate_product_data()
to replace
Related
I am developing a plugin. Main functionality has been developed but i want to add an option in these tags. These are blog post tags.
But i didnt find any way hook or filter to do it so. I have developed a like and dislike system and i want to show like and dislike count between the tags above shown in screenshot.
Please can someone tell me how I can change the position of my meta tags within my Wordpress theme so that they appear immediately after the initial "head" tag.
The reason is that when I look at the source code of my webpage I can see all my css code before I see my meta descriptions
BUT, the problem is, BING does not fetch the entire page, but only the first so many 1000s characters and as such it is not finding my "title" or "meta" tags and so my SERP listings are basically blank
If I can move the generation of my meta data "higher up" in the head tag and before the CSS then this will solve the problem beautifully.
The issue is, I have no idea how to do this...I think it something to do with the wp_head() function but whatever changes I've made have made no difference
I am using the all-in-one seo plugin if that makes any difference
Thanks in advance as this has been driving me nuts for weeks and I will confess that I'm not very good with wordpress as I am of a "certain age" where I still think DOS is wonderful :-) :-)
Dan
This depends on your theme (and maybe plugins). You should check in your theme's header.php if you can find it. Most of what is in the <head> is done by the wp_head. Both theme's and plugin can add stuff inside that with the hook.
I can't help any more without you providing more info (and code).
Hope this will get you started.
Rough steps;
Find where the <meta> tags are added, look for the wp_head reference.
Once you find it, use remove_action. Then re-add it with a higher priority with add_action.Look for the priority argument.
This way you can do it in your own theme, or a small custom plugin. You don't want to touch the plugin files or wp-core.
photo http://sleekupload.com/uploads/5/nb.png
How to write in functions.php
https://wordpress.org/plugins/woocommerce/
The hook that you are looking for is woocommerce_after_add_to_cart_button. To write a function, please review WordPress Plugin API. If this is too confusing, you have the option of editing the templates themselves by going to /wp-content/plugins/woocommerce/templates/single-product/ then you can do a search for woocommerce_after_add_to_cart_button. Keep in mind that updating WooCommerce may erase those templates so I advice you to keep your template files in your theme instead.
I'm creating a site where rarely, but it will happen, I will have a guest author. I looked at plugin for author boxes and none are basic enough for my needs.
I'm creating some basic CSS styles and hard coding an author box for those few times I need to worry about this.
What code would I put in a post to pull an avatar based on an email address? Seems like this is possible with a small snippet of php. Is there an easy way to create a shortcode to do it for me? I've only dabbled in WordPress modifications.
Thanks.
What I would do is use the Shortcode API:
http://codex.wordpress.org/Shortcode_API
With this, you can register a shortcode like
[author_avatar]
This shortcode would be simple, it would just use get_avatar()
http://codex.wordpress.org/Function_Reference/get_avatar
Based on the Shortcode API, you could essentially pass parameters through the shortcode, example:
[author_avatar email="author.name#domain.com" size="32"]
Than use wp_enqueue_style() to pull in your css
http://codex.wordpress.org/Function_Reference/wp_enqueue_style
I apologies for being brief I hope this is useful.
I am a food blogger and have recently learnt about recipe rich snippets. I found some material online, mostly being about plugins. I tried using ZipList plugin, which is actually pretty good, but
For some posts, I cannot add pictures within the recipe box and
I cannot add alt text to my pictures (which I find to be quite SEO-unfriendly or is it?).
So, I was thinking of trying to implement it by myself onto my website.
Any good links or advice on how to do it? I tried looking on google but I am only coming up with plugin tutorials.
Yes, your search results are correct.
If you don't want to use a plugin, you have to code it yourself. But this is the kind of thing that you don't want attached to your theme's functions.php ("without a plugin"). Because you have to be able to swap themes and preserve this functionality. Themes are for design and content display. Plugins for functionality. All those themes with SEO incorporated are simply dumb.
So, you end up writing your own plugin. See this article: Create a functionality plugins instead of using Functions.php.
What is a functionality plugin?
Traditionally, if you wanted to create a new function for your blog to add to its functionality, the advice has been to add the code snippet to your theme’s functions.php file. Now that’s all well and good and it will work fine, but what happens when you change your site’s theme (which you can guarantee will happen at least every few years) or the theme gets updated? Since functions.php is located in your active theme folder, if you change your theme, it inherently becomes defunct.
All that being said, what I'd suggest is that you create a Custom Post Type to handle your recipe snippets. You'll have all the default functionality of WordPress customized to your needs. The CPT could have only Title, Content and Featured Image, eventually your own taxonomy (recipe categories).
Useful links:
Documentation of CPTs
Smashing Magazine tutorial
WP Tuts tutorial
Or you can use a nice plugin to create your CPT :)