loop mix my child-category and parent-category

For the example you posted, the article is styled according to the css rule(s) for category-selling-and-advertising which is defined last (among the category-* classes) in the article’s class attribute. You need to intercept the functionality of post_class() to change the order these classes appear. The post_class filter will do the job for you: add_filter( ‘post_class’, … Read more

Function to get custom post image URL

Can you show us what the cp_get_image_url() function does? Is it from a plugin or theme? Is the image uploaded to the Featured Image or a Custom Field? Without knowing what that function is actually doing, the best I could come up with is this: <?php $media = get_attached_media(‘image’); foreach($media as $m) { $mee = … Read more

get_avatar from user id

To display users with specific ID’s on a page you’ll need to run a WP_User_Query, either by placing the following code in your functions.php and calling it with a shortcode or adding it to the page template: //Replace the numbers 1, 2 with the user ID’s to return $args = array( ‘include’ => array( 1, … Read more

How to show video from wp option value?

Your code: $cat_data = get_option(“category_$cat_id”); if ( isset($cat_data[‘extra1’] ) ){ echo do_shortcode(‘[videojs youtube=”‘.$cat_meta[‘extra1′].'” width=”699″ height=”269″ preload=”auto” loop=”true” autoplay=”false” controls=”false” class=”responsive-video”]’); } There’s a number of things you’re not doing or could do better here: You never check if the option exists, if get_option doesn’t find anything and returns a value of false your code may … Read more

How to get price of my products show in snippet on google?

What you’re after is called Rich Snippits which is structured data on your web page that tells Google specific information about your products. See https://developers.google.com/structured-data/rich-snippets/products A plugin like http://authorhreview.com/plugins/wp-rich-snippets/ might be what you’re looking for or you could modify your theme to add the right markup to make rich snippits work.