Articles of posts

Pagination on single post page?

I’ve found many pagination tutorials/plugins that work on pages displaying a list of posts such as index.php E.g. – However I want this to display on single post pages (single.php) so you can navigate through to the next/prev post. Any ideas?

How to pull blogposts using shortcodes

I want to grab the two latest blog posts on my homepage. i would also like the option to select the category if I want to also, but mainly just pulling the latest 2 blog posts. Thanks

Adding footers to posts?

I’m trying to add footers to the end of my posts. I need to be able to assign different footers to different posts (not globally). I tried using WP Post Footer, but it’s not working on WP 3.1.2.

WordPress – Hide posts in admin from user who did not write them

Working on a site and the user only uses two roles. Admin and Author. He has hundreds of authors writing on his blog and wants the ability to hide all Posts under the Posts section of the admin panel that the current logged in author did not write. Basically when an author logs in he […]

WordPress Orderby Numeric Value Not Working

I am trying to get all products from the wpsc-product post type and then display them by a custom meta field called release_date_year. However, it doesn’t appear to be ordering my posts by this custom meta value. I have read through countless blog posts, support posts on the WordPress forums and a lot of questions […]

Add Post Tags to Body Class

Want to add post tag name to body class – I am successful in using the code below to add category to body class – //adds new body class for post category add_filter(‘body_class’, ‘add_category_class_single’); function add_category_class_single($classes){ global $post; $category = get_the_category($post->ID); $slug = $category[0]->slug; $classes[] = ‘post-category-‘ . $slug; return $classes; } however when i […]

Injecting JavaScript into a Post with WP3.x

I have a client who is trying to inject some JS directly into a post using the web interface. The script is stripped out on the live site. I am unable to replicate this behavior on a local installation. The JS is added as expected. The main difference between my installation and the client’s is […]

Server-side sorting of posts

I have seen on some websites that you can sort posts server-side by passing in some queries like so: or How would I do this with WordPress posts on a page?

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’ => […]