0
votes
2answers
1k 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 ...
0
votes
1answer
31 views

Show more than one post on the main page excluding certain category

I'm currently running WordPress 4.5 with a WooTheme called The Morning After. I decided to change a few things here and there, but encountered some issues regarding the posts_per_page argument used in ...
-1
votes
1answer
39 views

Pagination 404 on my index.php

I'm trying for days how fix pagination on index of my wordpress site. Pagination work great on category and other archive but doesn't work on my index clicking on the page numbers have a 404. I found ...
0
votes
1answer
33 views

How do I display child post types in the parent post type template

I have a custom post type called airports which uses a template called single-airports.php. I have created a new airport called Gatwick and created a child of this called called Gatwick North ...
0
votes
1answer
28 views

Adding arg to search results page

I want to show future posts in search results, categories, etc. This site says to use the following code: $args = array( 'post_status' => array('publish', 'future'), ); query_posts( $args ); ...
1
vote
3answers
40 views

Unable To Get Published posts using query_posts

I'm not sure why this is not working as its a very simple query. It works when i pull all posts including pending, but not when i want to get posts that are only published. I have a function to get ...
-1
votes
1answer
75 views

Modify Blog Module layout in Child theme

I need to adjust how the featured image is displayed in their blog module. I need to change the display of the Featured Image from an IMG tag to a Background Image. So I can modify the frame (DIV) of ...
0
votes
0answers
69 views

How to prevent duplicate sticky posts

I trying to make a homepage for my Wordpress bootstrap theme which shows the sticky posts in a separate section stretching from side to side and below that I intend to show only 10 posts from the ...
4
votes
1answer
1k views

Some doubts about how the main query and the custom query works in this custom theme?

I am pretty new in WordPress theme development and I'm not so into PHP (I came from Java and C#) and have the following situation in this custom theme As you can see in the homepage I first show a ...
0
votes
1answer
48 views

Show Posts By Custom Field

I’d like to add 2 custom fields to my posts: show_post_on_home_page home_page_posts_order_sequence I then want my home page to show only the posts where show_on_home_page == true, ordered by ...
0
votes
1answer
37 views

Plugin Development: Storing and Manipulating Data That Fits JSON in Database

I am new to Wordpress plugin development but not web development in general. I have a website whose functionality I am trying to port over to Wordpress for a client that needs it in a custom plugin ...
0
votes
3answers
172 views

loop query exclude meta_key with meta_value

Hi I use a loop like this: // show all active coupons for this store and setup pagination $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts( array( 'post_type' => ...
7
votes
1answer
912 views

Using pre_get_posts on true pages and static front pages

I have done quite extensive research on how to use pre_get_posts on true pages and the static front pages, and it seems that there is no fool proof method. The best option I found to date was from a ...
0
votes
1answer
51 views

Does wp_query and query_posts affect website performance? [duplicate]

I've been aware about the difference of wp_query and query_posts. I just want to know what impact does both query methods to the performance of the page? Which query method makes the page load quicker ...
0
votes
1answer
50 views

Display list of custom post type which match taxonomy

I'm trying to add a snippet in my Wordpress sidebar which displays a list of links to posts which match a criteria. I'm using a Custom Post Type cars and a taxonomy car-types and I'd like to display ...

15 30 50 per page