Articles of posts

Disable auto-save and post revisions from inside a theme or plugin

Per default, the way to disable autosaving and post revisions, is to modify wp-config.php. Is there a way, to do that from within a plugin or a themes functions.php?

Subdomain to website directory blog transferring

I have a blog that is located on a subdomain blog.example.com and I have a main website located on example.com. They both use the same wordpress template. I’d like to transfer my blog from the subdomain to the directory of the example.com preserving ‘recent posts‘, ‘categories’ and other blog-ish features. I know that there is […]

Audio post format with Advanced Custom Fields

I am using the Advanced Custom Fields plugin to create custom fields for post formats. I have a field that only displays when the audio post format is selected. This is a text filed where the user places a url from a soundcloud audio file, for example and then the the audio file should show […]

Can I change my post type to anything and my site still work?

I’m working on an application using WP as my CMS. I was successfully creating new posts and working with them in my app. But I noticed when visitors went to the website they were being listed in the blog (in the loop). I don’t want them to show up there so after doing some research […]

Display Custom Post Type in Recent Posts

I have the following problem: I have created a custom post type matratze and currently besides the custom posts no other posts exist. Hence, nothing is being displayed under the recent posts. The custom post type looks like the following: [custom post] My recent posts do not get displayed: [main homepage] I tried the following: […]

Get posts and include taxonomy term

How can I return taxonomy terms within post data, from the same query. Currently I’m calling get_posts / wp_query and then looping over and calling wp_get_post_terms. Needless to say it thrashes the database and results in far too many queries. For context, I’m listing all WooCommerce products (‘product’ post type) and then adding in ‘designer’ […]

How to get all posts belongs to a user between a certain date

I am writing a plugin for my company so I need to get all posts belongs to a user between a certain date which is given by another user. Then I want to count words for each post and finally add them up to a variable and save that value to the database. There are […]

Is it possible to change the admin posts per page view?

In the admin panel (backend) when you go to “posts” it shows you a pagination (in my case with 29 posts per page). Is it possible to change to posts per page number for a specific post type? Thanks.

Linking to pages/posts within the site

I’m trying to add links to my posts. How can I link to my pages where I don’t have to use the domain but only the pathway? Default: http://domain.com/post-title Change to: /post-title I once had a client who had this functionality on her WP site.

Wrap every month posts in div

I have a code which wraps every 4 posts in div. How can I adapt it to wrap every month posts in div. <?php $args = array( ‘post_type’ => ‘posts’, ‘posts_per_page’ => -1, ‘order’ => ‘DESC’ ); $the_query = new WP_Query($args); if ($the_query->have_posts()) : $counter = 0; while ($the_query->have_posts()) : $the_query->the_post(); if ($counter % 4 […]