Renaming or Moving WP-Content Pros/Cons

I always recommend installing WordPress manually yourself. Some companies will insert a link crediting the hosting provider for the install. In the past, I’ve experienced 1-click installations that are not running the latest version of WordPress. In terms of migrating your website, you should follow this guide: http://codex.wordpress.org/Moving_WordPress. Smashing Magazine also provide an easy tutorial: … Read more

Related posts with WP_Query

parent is your answer here. Every term have a parent value set in its parent property. This value is an integer value, and represent the term id of its parent term. All top level terms have a value of 0 which just simply means it is a top level term First we need to build … Read more

No exposure on search engines

Please go to Settings > Reading or wp-admin/options-reading.php If it’s not unchecked it will not allow search engines to reach. For further modification information related to robots you can use the below plugin to modify robots.txt file: Plugin – Multipart robots.txt editor To see your robots.txt file you would visit the link as: http://www.example.com/robots.txt

Ajax Load More or View More functionality for woocommerce category layout by template overriding

You can achieve this by create a template override for woocommerce category layout. How to Create Template override Go to wp-content/theme/{your_theme} Create a folder named woocommerce if already not exist Then create a file titled archive-product.php Now, paste the below code as instructed and modify any parameters per your need Add this code right after … Read more

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 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 Delete Posts by title?

Like keepkalm said I’d find the list of post IDs from the database: select id, post_title FROM wp_posts where post_title like ‘%Pharmaton%’ or post_title like ‘%Winston Blu%’ or post_title like ‘%Kefir%’ or post_title like ‘%Tetradox%’ or post_title like ‘%Passport Sco%’; and then use the list of IDs with wp-cli’s wp post delete which accepts a … Read more

Pagination showing same posts despite changing page

After struggling for hours on this (and 6 years after the question was asked), for me the solution was lying within the $paged parameter: I changed $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1; to if ( get_query_var(‘paged’) ) { $paged = get_query_var(‘paged’); } else if ( get_query_var(‘page’) ) { $paged = get_query_var(‘page’); } … Read more

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