Linked Questions

0
votes
1answer
19 views

Wrong post title displayed from loop

I'm building my own theme. I have a page set for my blog (with a template that I made) which I'd like to just display a few of my posts. It uses the following loop: <?php ...
0
votes
0answers
21 views

WP_Query is being reset after <header> tag (using chaining method)

I'm creating a page template. In this page template I create a custom query. - page-recipes.php: <?php /** * Template Name: Recepten - archief * chained with /archive-recipes.php * */ ...
0
votes
1answer
19 views

2 queries with counters

I have 2 loops on a page both containing a counter to implement slightly different code every 6 posts. For some reason though the second loop is implementing the different code sometimes after 4 items ...
0
votes
1answer
35 views

How to do a loop inside a loop?

I'm trying to get posts from a custom posts using WP_Query. <ul> <?php $query1 = query_posts( array( 'posts_per_page' => -1, 'post_type' => array('specialties') )); ...
0
votes
1answer
102 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
20 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 ); ...
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
0answers
23 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
48 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 ...
0
votes
3answers
84 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 ...
0
votes
1answer
49 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
0answers
58 views

Why doesn't my WordPress page show the most recent post?

I was wondering if someone could help me with the following. My news page on my WordPress website doesn't show the most recent blog post, which I want it to do. The code I have is: ...
2
votes
3answers
117 views

PHP memory friendly alternative to get_posts()

I was running into memory issues with this: get_posts( array( 'posts_per_page' => '-1', 'post_type' => array( 'product', 'product_variation' ) ) (there are thousands of results) just trying to ...
1
vote
2answers
45 views

All posts are still shown when adding category argument to query

I've got the following code in my team-type.php file which I'm using to create a custom taxonomy for a member information: function create_team_taxonomies() { $labels = array( 'name' ...
0
votes
0answers
43 views

Remove duplicates from foreach

I'm trying to loop through a custom post type and display all meta values for a meta key. I'm able to display all the values, however there are some duplicates. I want to remove those duplicates. I ...

15 30 50 per page