Define PHP variable from a seperate API if statement

Hi I’m the author of Multi Rating Pro. The simplest way to do this is to put this logic within the rating-result.php template file. You can call the API function passing in your own result_type and then check this in the template. if ( class_exists( ‘MRP_Multi_Rating_API’ ) ) { MRP_Multi_Rating_API::display_rating_result( array( ‘rating_item_ids’ => 1, ‘show_count’ … Read more

Assign custom parameter to each post in query

It’s a neat idea! The way I would tackle the problem is to create an associative array of post IDs mapped to their individual weights. Since weights are subjective – that is, the represent the value of other posts’ relationships with the post currently being displayed – it doesn’t make much sense to store these … Read more

Add a variable in a post

One option would be to set up a shortcode. You can add this either in your theme’s functions.php, or as a plugin: add_shortcode(‘varnumber’, ‘my_var_number’); function my_var_number($atts, $content = null) { return ‘Put whatever number you want here instead of this text’; } Wherever you want the number to appear, use the shortcode [varnumber] in the … Read more

How to search variable product by its variation id in woocommerce admin product search box?

Finally I have implement the above functionality by modifying the filter “posts_search”. By using bellow code you can search variable products by their variations id in woocommerce admin product search area. add_filter( ‘posts_search’, ‘product_search’ ); function product_search( $where ) { global $pagenow, $wpdb, $wp; if ( ‘edit.php’ != $pagenow || ! is_search() || ! isset( … Read more

Passing parameters to a static front page

front-page.php is a static front page (if you rename your current template front-page.php, and don’t select nothing in Settings->Reading it works exactly like now. However, if you want to use the page approach and you don’t use mcdata for query, remove the filter you posted, and simply retrieve the mcdata value in your template using … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)