0
votes
0answers
8 views

Timeout error 504 with 2 query_posts , how can I make them work?

Im experiencing a error: ERROR 504 - GATEWAY TIMEOUT I have this loops that works fine IF in logged... if not, it doesn't work... Update: I have deactivated one of the query_posts and it works. ...
7
votes
5answers
5k views

the_date() not working

I am using wordpress 3.2 and I did a query post like this: <?php query_posts("posts_per_page=1post=type&page=post_parent=10");?> Then I try to echo out the date of this post I queried ...
1
vote
1answer
5k views

How to display related posts from same category?

Is it possible to display related posts from same category as the current post?
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 my_function($...
5
votes
2answers
22k views

How to get posts published between a date and today?

Is it a way to get posts published between a date and today with query_posts() ? Example : All posts published since 2012-04-01 Thanks EDIT : How to add the filter date on this Query Posts ? ...
-1
votes
0answers
29 views

Posts pagination bug

My index.php looks like this: <div class="container"> <div class="row"> <div id="primary" class="content-area <?php echo apply_filters('primary_bootstrap_class', 'col-sm-...
0
votes
1answer
100 views

How to remove /page/2/ from home page?

First of all: I don't understand the meaning or the action that http://myurl/page/2 does? I checked the Net tab in Firebug and saw that my page takes more than 3 seconds to load /page/2... but I don'...
3
votes
2answers
68 views

Is `query_posts` really slower than secondary query?

I know the main query is fast, since it gets data after parsing the URL and after WP_Query has been instantiated. We are in OO PHP. But is query_posts really slower than some secondary query that ...
8
votes
2answers
136 views

Why query_posts() isn't marked as deprecated?

There are two query_posts() functions technically speaking. One query_posts() is actually WP_Query::query_posts() and the other is in global space. Asking from sanity: If global query_posts() is ...
0
votes
0answers
21 views

Display Posts in Admin Page

I create a admin page. Now I need to display posts in that page. Should I use WP_Query or get_posts()? (Pagination should be there) Note : I have read When should you use WP_Query vs query_posts() ...
10
votes
1answer
1k 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
37 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
41 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
37 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
31 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
46 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
114 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
72 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
52 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
44 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
194 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' => ...
0
votes
1answer
63 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
63 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 ...
1
vote
2answers
45 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( 'posts_per_page' => 3, 'orderby' => '...
1
vote
1answer
61 views

Sort by meta key on archive page

I am trying to sort an archive page using a meta key value (which happens to be a Unix timestamp). Currently I have the posts listed on the page by their WordPress creation date. I want to use the ...
0
votes
1answer
14 views

Plugin outputs content of posts unbidden!

I've written my first plugin. The intent is to show the image, title and excerpt of the first 6 posts. (It uses a function from Divi, here and there). function jm_blog_layout($atts) { ob_start();...
16
votes
4answers
12k views

Is there a flowchart for wordpress loading sequence?

So like wp must load series of files from, index.php -> ... -> wp-header.php -> ... ->functions.php ...and so on upon execution. Also there must be a similar flowchart for functions ...
50
votes
2answers
42k 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
1answer
33 views

Loop doesn't work

I'm making a box in my sidebar that shows with a loop a list of articles of a single category: <?php // The Query query_posts('cat=31&posts_per_page=5'); // The Loop while ( have_posts() ) : ...
0
votes
1answer
52 views

Randomly load categories with latest post

I am creating a slider that loads 5 different categories. The categories are randomly loaded into the page. So I know the id's of the categories and they are loaded random to the page. What I want to ...
2
votes
2answers
89 views

Alphabetizing Posts in a Category Page?

I have written up a page template that will list posts in the same category as the name of the page. I am wondering how to alter it to get it to return the posts in alphabetical order? I have been ...
0
votes
1answer
267 views

pagination redirecting from page number url before page requested

I have a CPT called staff. On their single-staff.php pages i have a list of items they are related to. This has become too long so now we want pagination. I can create the page links fine but it ...
0
votes
1answer
78 views

Which method is faster to get a single post?

If I want to get only a single post with the featured thumbnail. Which of the function is better to use (for the performance) get_post or WP_Query?
0
votes
0answers
88 views

Used with meta_query in query_posts works slowly

Hey i have a problem this my code and if i used with all parameters i get from $_GET its start work so slowly..... (like 5 min). $checkbox = array( 'immediate'=>'כניסה מידית', 'air'=>'...
9
votes
2answers
3k views

Looking for WordPress System Diagrams

I am looking for WordPress chart/diagram system design. I found only the template hierarchy diagram, but it's only part of the system. source: http://upload.wikimedia.org/wikipedia/commons/3/3d/...
0
votes
1answer
18 views

Adding options to loop

I made my first theme for Wordpress, but I am interested in one thing so if anyone can point me to right direction. My theme has 4-5 loops, depending on category that it need to show. I want to add ...
4
votes
1answer
1k views

Random post, once per day

I have a custom post type 'quotes' and I would like to display a random entry on the homepage each day. This is the code I currently have to display the content: <?php query_posts( '...
0
votes
1answer
680 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 ...
-1
votes
2answers
84 views

show posts from some category and sort by advance custom field

i want code that show display some category and sort by acf field. for example show all post from category 122,123,124 and sort all of them by acf (for example : lastname ). please write code for me. ...
0
votes
0answers
41 views

Query posts by switch

I need your help to add a case to a switch in my theme to order posts. My theme uses a query_post: query_posts( $query_string . $orderby ); In the loop to order generated posts. The query uses ...
0
votes
1answer
636 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
1answer
100 views

Hide posts belongs to few categories in homepage

Currently I am using all the latest posts are displaying in the homepage settings. But now I need to hide few specific categories to be displayed in the homepage. All the post belongs to those ...
0
votes
0answers
41 views

Use one column per category

I dont typically do wordpress development, though I am a PHP developer, so I get those concepts. I apologize if this has been asked and answered already. I looked through the questions as they ...
0
votes
1answer
58 views

Modifing archive query affects show post count function

I'm trying to modify the archive query of archive page with this function hooked to pre_get_posts action hook. // Load our function when hook is set add_action( 'pre_get_posts', '...
0
votes
0answers
28 views

Sort by manipulated meta_key

I have a page where I sort my posts by a custom field called "price". The problem is that the field values come with commas because that's the way they should display on the front-end (e.g. 1,000,000 ...
0
votes
1answer
146 views

How to display 3 post per slide

I need to create a sliders contain 3 post title for each slide. I can create it by one title for each slide but not 3 posts Could you please help me This is My code <ul class="overview"> ...
0
votes
0answers
126 views

How to make multiple loops (of different categories) on Homepage but with one echo code

My homepage has 7 similar loops in it. The only differnce between them is the number of posts and the category id. Everytime I want to change the HTML code inside the echo I need to change it 7 times. ...
0
votes
0answers
192 views

Some posts appear in duplicate with paginated query

I'm querying a custom post type with some custom post meta, and then output the results. This is the query: $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $properties_query = array( ...
5
votes
4answers
1k 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 ...

15 30 50 per page