Different Urls for mobile and desktop homepages

I don’t think you can accomplish this using WordPress alone since there is no way (that I know) for WordPress (or PHP for that matter) to detect if it’s desktop or mobile. I’d imagine you could use some simple Javascript however to detect if you’re on mobile and then use window.location to redirect to your … Read more

How to delete posts older than one year with post meta, post attachments and files?

I find-out an way, when working on a cron related project. 1. Install and active [WP Crontol plugin][1] 2. Go to Tools->Cron Events. 3. Create new cron job at `Add PHP Cron Event tab. Here, I use PHP code global $wpdb; $posts_table = $wpdb->prefix . ‘posts’; $term_relationships_table = $wpdb->prefix . ‘term_relationships’; $postmeta_table = $wpdb->prefix . … Read more

WordPress connecting posts

Check out Posts 2 Posts. It’s older, but it’s rock solid and saves a ton of work. There’s a github library and a plugin, depending on how you plan to implement it. https://github.com/scribu/wp-posts-to-posts https://wordpress.org/plugins/posts-to-posts/ Good luck.

Related post based on 2 categories

You can do it like below- $query = get_posts( array( ‘category__and’ => array( 6, // Your category-1 ID 7 // Your category-2 ID // And so on and so fourth ) ) ); Now in $query variable you’ll get the object of posts which are in both Category 1 and Category 2 and so on … Read more

How can I add a custom checkbox / radio button on the admin theme options to display a CSS or other?

This is a fairly broad question. There are many approaches thinkable, but here is the lay-out for an easy one: Build a child theme, consisting only of a style.css. Find the id of the highest level wrapper in the theme, let’s say 2016id In style.css add style rules that depend on the class of the … Read more