post__in not recognizing multiple IDs

This is more of a PHP than a WordPress issue: If $newstring = ‘15,30’; then array($newstring) is an array containing this string. If you print_r( array($newstring) ), it looks like this: Array ( [0] => 15,30 ) Which is not the same as array(15,30). What you want to do instead is: $newstring = ‘15,30’; $args … Read more

How to filter homepage posts by popularity? [closed]

First thing we need to do is create a function that will detect post views count and store it as a custom field for each post. To do this, paste the following codes in your theme’s functions.php file function wpb_set_post_views($postID) { $count_key = ‘wpb_post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ $count = 0; delete_post_meta($postID, $count_key); … Read more

Add Custom field under the post title [closed]

The position param is responsible for that. You can find all params with descriptions here. So you’ll have to change that part of your code: ‘options’ => array ( ‘position’ => ‘normal’, ‘layout’ => ‘no_box’, ‘hide_on_screen’ => array ( ), ), to this: ‘options’ => array ( ‘position’ => ‘acf_after_title’, ‘layout’ => ‘no_box’, ‘hide_on_screen’ => … Read more

No way to add instagram in AddToAny Plugin?

From reviewing the documentation it looks like Instagram isn’t supported directly. However, AddToAny supports custom services. Just take a look at the product documentation ‘Custom Services – WordPress‘

IF taxonomy archive is hierarchical THEN

Look at the docs (please read the docs) for is_taxonomy_hierarchical(). You need to tell it which taxonomy you’re checking: if ( is_taxonomy_hierarchical( ‘my_taxonomy_name’ ) ) { } If you’re template isn’t specific to a taxonomy, and you need to know which taxonomy you’re viewing, use get_queried_object() to figure it out (you were already told how … Read more

How much does $wpdb->prepare(), then $wpdb->query() VS straight $wpdb->query(), can slow down the load time of whole page

$wpdb->prepare shouldn’t make any significant difference. As you can see here (https://developer.wordpress.org/reference/classes/wpdb/prepare/#source), it doesn’t do much. It’s just taking care of proper escaping and formatting variables, so the final query is safe to run. So if you’re asking if there is a big difference between $wpdb->query( $wpdb->prepare( … ) ) and $wpdb->query( <SAFE_SQL> ), then … Read more

How to improve my site’s loading time?

You are using Woocommerce which starts a session for every visitor to your site. This limits Cloudflare’s cache performance since each unique session needs to be handled individually. That’s how things like the shopping cart work. Woocommerce added the ability to store this session data in object cache rather than the database (memcached/Redis/etc). I’m not … Read more