Categories
CMS Mastering Development Wordpress

How can we make “dropdown-pages” of “wp customizer” draggable like nav menu

I am creating onepage site layout for wordpress theme for that i added dropdown-pages under wp-customizer. I want to know if it is possible to make dropdown-pages drag-drop able… i am unable to set templates for them below is the image of dropdown-pages and php code i used to call these pages, but If it […]

Categories
CMS Mastering Development Wordpress

Woocommerce add and show star ratings

I want to show the rating stars on 2 places on my woocommerce website: In the custom product loop And the single product page I’ve added do_action(‘woocommerce_template_loop_rating’); in the product loop and added do_action(‘woocommerce_template_single_rating’); and the single-product.php page. But nothing happens. I’ve selected these 2 options in the Woocommerce settings: Enable star rating on reviews […]

Categories
CMS Mastering Development Wordpress

Pagination on author.php page with custom var

I have a WP_Query on the author.php page that queries a users favorite posts stored in custom metadata. $author = get_user_by( ‘slug’, get_query_var( ‘author_name’ ) ); $author_id = $author->ID; $favorite_post_ids = get_user_meta($author_id, ‘wpfp_favorites’, true); $args = array( ‘post__in’ => $favorite_post_ids, ‘posts_per_page’=> -1, ‘orderby’ => ‘post__in’, ‘post_type’ => ‘post’, ‘paged’ => $paged ); $the_query = new […]

Categories
CMS Mastering Development Wordpress

create custom shortcode wp and put php code in

i use ACF plugin and i want put this query in shortcode. but i have a problem. add_shortcode(‘pishnahadi’ , ‘kn_inline_related’); function kn_inline_related( $atts ) { $html= ”; $posts = get_field(‘pishnahadi’, false, false); $loop = new WP_Query(array(‘post_type’ => ‘news’, ‘posts_per_page’ => 3, ‘post__in’ => $posts, ‘post_status’ => ‘publish’, ‘orderby’ => ‘post__in’, ‘order’ => ‘ASC’ )); if($loop->have_posts()) […]

Categories
CMS Development Wordpress

Weird orderby => post__in issue

I seem to have run into a sort of odd issue with WP_Query post__in I can’t quite figure out. ANY help is appreciated! Goal/Progress so far: Overall I want to merge two arrays and use the merged array inside a WP_Query. I currently have two get_posts queries, one has 5 posts (can be any number), […]

Categories
CMS Development Wordpress

Edit plugin function with a hook

I’ve just spent 2 days on trying to pass/change an argument in a plugin’s function but had no luck so far. Would anyone, please, show me the correct way or solution how to do that? I need to be able to change value ‘cat’ => ’44’ with a shortcode to any other value written in […]

Categories
CMS Development Wordpress

Top rated posts Average rating issue

I am trying to show top rated posts, cpt with AVG rating value.I created the custom widget for this. Defaults wp posts data and AVG value is showing correct but a CPT like Movie post not showing correct AVG value. I’m using following code to achieve this. Need help public function widget( $args, $instance ) […]

Categories
CMS Development Wordpress

How to display related posts from this code?

I have two scripts to display related posts that fit my terms, but I don’t know how to call them, please help me. I found this code here. Related Posts 1: function get_pew_related_data($args, $post_id, $related_id) { global $post, $wpdb; $post_id = intval( $post_id ); if( !$post_id && $post->ID ) { $post_id = $post->ID; } if( […]