Articles of posts

Create cron job without a plugin?

Basically I wrote a function that lets me change the post status to draft depending of a field in the postmeta table: /** * Remove ads if they have been sold for over 5 days */ function cp_remove_sold_ads(){ global $wpdb; // Get all sold ads $sold_ads = $wpdb->get_results(“SELECT * FROM ” . $wpdb->prefix . “postmeta […]

WP Query related posts by current page Tag ID

I am trying to output related posts of the current post by tag_ID. With the current code, posts will output all posts from the property tag instead of specific tag. How can I only return posts based on the current posts tag_ID? <?php $post_tag = get_the_tags($post->ID)?>//Not sure if correct <?php $args = array( ‘post_type’ => […]

Disable Jquery UI post tabs

Hey all, I’m using Jquery UI tabs with the WordPress Post Tabs plugin and it works like a charm. However, I’d like to auto disable or hide tabs that do not have any data. I’ve worked with Jquery quite a bit but I’m lost in this mess. Any help would be appreciated. Thanks! Jquery Tabs […]

Differentiate between posts and pages in search results

How can one differentiate between posts and pages in search results? What I need to do is show a the_time div for posts but not show it for pages, as it’s irrelevant. With a function? <?php if (!is_page()) } in the loop below doesn’t help. <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?> […]

What is the Better way to manage posts in WordPress?

I am looking for a plugin or a “tool” that would mod the administration interface and would allow me to mass edit the posts. Currently the posts are paginated by 20 post per page, if i have to turn 1000 post into drafts or delete them – i have to browse multiple pages. Same for […]

WordPress Theory Lesson – Image Columns within posts with alignment?

Trying to get my head round a request from a client, and thought I’d try to hivemind the solution a little bit. The client requires a two column post layout, with images down the right and text on the left. Now, that bit it relatively straight forward (he says, having not tried it yet), but […]

how can I set the post author of a post I just created with php?

I’m using php to dynamically create a custom post, and I need the author to be someone other than the logged in user. I found this but I’m wondering if there is a way to do it after the post is already inserted. I guess I could just do a db query…

Query only Posts from Both of Two Category?

I have 3 categories, 1.OnGoing projects(cat id=’5′) 2.Completed Projects(cat id=’6′) 3.Upcoming Projects(cat id=’7′) and also i have another 2 categories:(Not a Sub Category) chennai (cat id=’10’) Dubai (cat id=’11) How to get the post from “OnGoing Projects” with “Chennai” category?(I like to Display -> OnGoing Projects on Chennai.) I have tried the following code: <?php […]

WordPress list posts from sub categories

has anyone an ideea how can you do something like this: So if the user is in a category, let’s say Mainand this categories has some subcategories and I want to list them and also list the posts, something like this: Sub category name 1 -POST 1 -POST 2 Sub category name 2 -POST 1 […]

which action to hook to in order to perform post-publish action

I have some functionality I’ve written in order to post the title and link for the post to twitter whenever a post is published. I’m wondering which wp function to hook this to? save_post has no real reference documentation. Basically I just want to run an action when a post is successfully published. Thanks very […]