Linked Questions

0
votes
1answer
26 views

Custom meta box with jQuery.sortable custom post type list

What I'm trying to do is have a custom post type ordered differently on different pages. I've searched around for quite a while and can't seem to find anything to help. I have a post type named staff ...
0
votes
0answers
15 views

posts_per_page not returning correct number of posts

$queryArgs = array( 'post_type' => 'recipe', //'orderby' => 'menu_order', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 10, // 'posts_per_page' => -1 ); ...
4
votes
1answer
609 views

WP_Query ignores post_type in category view

I have following query to select posts by my custom post-type. This works fine while being on the frontpage (the snippet is included in the sidebar). As soon it gets executed on a category page the ...
0
votes
2answers
299 views

wp_query within function within wp_query

I have a query which looks like this: $args = arguments for the query $query = new WP_Query($args); while ($query->have_posts()): $query->the_post(); $post_id = get_the_ID(); echo ...
1
vote
2answers
21 views

Posts not showing on page

Can anyone spot anything wrong with this code(see below). No content is showing up on my page. Many thanks in advance. <?php $args = array( ...
0
votes
1answer
268 views

Order by ASC, DESC, Title, Date from URL on custom page template post

I have a Page with Custom template. In this template I have index all posts of a category with many more modification. I know i can do this by creating Category specific template but this is different ...
0
votes
0answers
22 views

Getting duplicate results from query

I'm confused as to why I'm getting duplicate posts showing up in my code for two related blog posts (by current category). The secondary posts are showing up outside the intended div, and not even ...
0
votes
1answer
36 views

WordPress show custom post type on homepage

How do I display custom post type in homepage? This is my custom code: // Add the Meta Box - Resorts function add_custom_meta_box() { add_meta_box( 'custom_meta_box', // $id ...
18
votes
1answer
12k views

How to fix pagination for custom loops?

I have added a custom/secondary query to a template file/custom page template; how can I make WordPress use my custom query for pagination, instead of using the main query loop's pagination? Addendum ...
0
votes
3answers
2k views

Check if meta key value already exists

Let's say that I have few posts with meta key "videoid". Value of that meta key is different for every post (and has to be different). When adding new post, how can I check if videoid with that exact ...
6
votes
1answer
6k views

How set featured posts using checkbox in post edit screen?

I want to make selecting a featured post is just by checking a checkbox in edit screen AND be able to retrieve these featured articles from only specific category ? in short what I'm looking for : ...
0
votes
3answers
62 views

How to display a specific category using a custom Query?

Hi I want to display a specific category from a custom query in WordPress. My code works fine and it gets the latest 4 posts, but what I want now is to retrieve a specific category. My code is below ...
1
vote
4answers
3k views

Wordpress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I've encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ...
0
votes
1answer
40 views

how to show the post category name

I'm novice on wordpress development and I have this problem. How can I show the post category name? Example: Post Title: Wordpress Rules! Post author: Irwin R. Post Date: 22/09/2014 Cat Name: ...
0
votes
2answers
268 views

getting the post_id from the post_meta

I need to find out the post_id of a post_meta record where the custom key is 'XYZ' and the is 'ABC'? Is there an API for that? Or do I need to run a regular select SQL with wpdb class?

15 30 50 per page