Set up The Loop with query parameters. This will override the current WordPress Loop and shouldn’t be used more than once. This must not be used within the WordPress Loop.

learn more… | top users | synonyms

0
votes
0answers
10 views

Filter RSS feed for custom post type to events for next 7 days only

I'm trying to create a custom RSS feed that shows posts from the custom post type 'events' for the next 7 days ahead only. The feed is already sorted by event start date order rather than published ...
3
votes
1answer
22 views

Query Custom Meta Value with Increment

I have a Query searching for a meta value I have added to my posts (meta-select). I have it feeding out in a loop with 4 results. Let's say I want this loop to start with the meta value "2" and work ...
0
votes
0answers
31 views

archives page ordering posts by multiple custom fields with query_posts

On my archives page, I am displaying posts ordered by a custom field 'date1'. This is the code that I am using, and it works. $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( ...
0
votes
2answers
24 views

Why in this archive page that call query_posts() function show only the last 10 posts?

I am pretty new in WordPress theme development and I am finding 2 problem with this posts archive page: http://lnx.asper-eritrea.com/archivio/ The previous page have to show ALL the blog posts into ...
0
votes
1answer
14 views

Custom query posts error

I have the following code which display different things, that's why I'm using many filters in the query. The problem is that it displays the same thing, no matter the query from the switch. If I do ...
0
votes
1answer
21 views

Custom post query error

i have a ~46k rows in my wp_posts. All i want to do is to query the database that meet my queryes and display the resulted posts but my problem is that any query that i`m doing to the database it ...
0
votes
2answers
22 views

How to exclude post from being queried based on custom meta value

I am building a reviewing system for user-submitted posts on my website. I have a page called page-review.php which displays the oldest post of the "pending review" category. This is to ensure that ...
-1
votes
2answers
24 views

How to modify this function to exclude also the post belonging to a specific category?

I am very new in WordPress development and I have the folglowing problem. I use this function (declared into the functions.php file of my theme) to modify the main query in such a way that the post ...
0
votes
1answer
15 views

Saving a post ID to use in a form elsewhere on website

I am trying to save a certain queried post's ID to pass on in a form outside of my loop. To be more specific. I have one file named review.php, this file contains a Wordpress Loop which queries one ...
0
votes
1answer
27 views

How to save posts position on homepage after random function?

I use the following code to display a random post on a homepage: <?php global $query_string; query_posts($query_string . "&orderby=rand"); ?> When the page is refresh posts positions are ...
-1
votes
0answers
7 views

Display current user posts (Multi author)

I want to display the posts author when he is logged. So I use : wp_get_current_user(); $args_my_items = array( 'author' => $current_user->ID ); query_posts($args_my_items); The problem ...
1
vote
2answers
46 views

Custom query works but returns “Undefined Offset: 0”

My custom query works, except when debugging it throws off an error: Undefined Offset: 0 in /wp-includes/query.php This is what my query looks like : <?php $loop = new ...
0
votes
1answer
23 views

Query function not executed between <div> element [closed]

I'm wondering why the following code is not executed between the element it's put in. I know sort of how to fix, but I'm not sure if that's the best solution. My code: First function function ...
0
votes
2answers
17 views

Display an author's posts on his own author page

I have a blog that publish articles of any philosophers.Each philosopher has a special page that includes information about him. I've created a post type called philosopher. I want to display the ...
1
vote
0answers
13 views

Wordpress tax_query not showing private posts

When querying posts with the following: $getClientsArgs = array( 'post_type' => 'client', 'showposts' => -1 ); query_posts($getClientsArgs); Private posts are displayed if the person ...
0
votes
0answers
33 views

How to organize a WP_Query's list of posts by category and display category title?

If I run a query with some args and get a list of posts, how can I organize the posts separated by category and display the title of each category? $array_out = array(); $args = array( 'orderby' ...
0
votes
3answers
63 views

Exclude posts from homepage having a specified tag

I am pretty new in WordPress development and I am trying to implement this custom theme that handle the so called featured posts As you can see in the posts area of the homepage I have the Articoli ...
1
vote
3answers
53 views

Can I set and show “important” post in my blog?

I have the following doubt related to the WordPress posts showed in the home page. I know that in the home page I can show the latest published posts. But can I also show (before the latest posts) a ...
0
votes
0answers
9 views

query_posts, and filter with a meta_key that is an array [duplicate]

Inside one of my custom post types, I have a custom field that gets its values from another custom post type, and show them in a dropdown menu, something that's called a Relation Custom Field in PODS. ...
0
votes
1answer
35 views

Automatically create a loop for post ID

I am having trouble generating a loop for my post. The JS calls the slide_ID which then needs to display each slide-ID in numeric order for it to work. Example for slide-1 to scroll to its next slide ...
0
votes
1answer
38 views

Show all posts of all categories but excluding a category on custom blog page with pagination of my theme

<h3>Recent Posts</h3> <?php // Display blog posts on any page @ http://m0n.co/l $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $temp = $wp_query; $wp_query= ...
0
votes
3answers
48 views

Echo the number of posts being displayed

I had this code working as I needed it to...but now I need to add a post count where the "____" is, beside "posters", so I can manipulate the css depending on how many posters are showing, for ...
0
votes
0answers
14 views

Cron job to delete post by title

I've searched a lot and I didn't find nothing that could help me. So, I want a cron job to automatically delete posts that have no title. Why I want that? I have a IFTTT recipe that automatically post ...
0
votes
1answer
31 views

Using $seed on a custom post type for randomly displayed posts

I saw this link to display posts randomly without duplicating them. However how do you apply this to a custom post type? Below is what I'm using in functions to make it randomly display. ...
0
votes
2answers
39 views

Easy way to write complex queries in wordpress

I want to run one sql query like this in wordpress. Just wanted to know if there is an easy way to do this in wp. Thanks. Is this query possible with the use of query_posts anyhow? select ...
0
votes
1answer
39 views

Exclude a category of posts in author template

I'm using the following author archive code: <?php /** * The template for displaying Author Archive pages. * * @package Cryout Creations * @subpackage Parabola * @since Parabola 1.0 */ ...
0
votes
1answer
67 views

Wordpress - thumbnail image from youtube (function and loop)

Hi :D i need show thumbnails from youtube in homepage, i have a code for wordpress in function and the loop but not working thumbnail from youtube. What can be wrong with the code? Function Code: ...
0
votes
0answers
14 views

Posts Duplicating due to Pagination and Custom Query

I have a custom meta field named “price” and I would like my main query to order the posts from highest to lowest price. Currently I have it setup like this: <?php $paged = ...
0
votes
1answer
15 views

How do I control the fallback query after the original query returned cero posts?

I just figured out why WP developers expect you to create a separate 404.php page to control the output of that page. (and the silence about any attempt to do it otherwise) It's basically because ...
0
votes
0answers
30 views

query_post causes the posts to be loaded twice on load more posts

I am using query_post to randomize the posts in a custom post type. However this causes the posts to be loaded reloaded when i load more posts in. Below is my code: <?php ...
1
vote
1answer
71 views

How to exclude post formats from wordpress recent posts in a tabs widget

hey guys so i have a problem is that what i want is just standard recent posts only to show and i using a function in my the theme function file to show the recent post the code of the function ...
1
vote
1answer
43 views

WP query exclude post within the last month / only show over 1 month old

I need to create a landing page which only shows posts that are at least a month old. Everything I've read / tried with the date query so far seems aimed at including posts between the last month ...
0
votes
0answers
17 views

Sort posts of custom_post_type according other post_type with metabox

I'll try to be as specific as possible because it's a bit confusing what I require. I'm trying to make a connection between two post_types with the help of a Metabox; This Metabox is showing in ...
0
votes
2answers
37 views

posts_nav_link pulling in multiple post types

I have an archive-regularproducts.php set up that looks like so: PHP: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> //content goes here <?php endwhile; ...
0
votes
1answer
55 views

query_posts orderby multiple ways

I have a problem with query_posts orderby multiple ways. I have in Wordpress one category where I need display first posts with have a rank and after display all posts by title. Below are working ...
2
votes
0answers
55 views

Keep featured content post in homepage with original order

I'm searching how to keep the featured post in my blog homepage without excluding it from query post. My blog uses the Twenty Fourteen theme. I found this solution. Open the featured-content.php ...
0
votes
0answers
13 views

Getting latest posts from network [duplicate]

I'm using example from here to get latest posts from the WP network: http://www.smashingmagazine.com/2011/11/17/wordpress-multisite-practical-functions-methods/ The function: function ...
0
votes
0answers
34 views

Max Posts and Memory Limit

So I have a custom post type which uses ACF Metaboxes that contains over 750 posts and grwoing. I got the infamous white screen of death because it seems like PHP has exhaused it's memory limit ...
0
votes
1answer
35 views

Wordpress query portfolio posts

On my template I have this code <div class="blog_block"> <?php wp_reset_postdata(); ?> <?php $nbmax= 9; ?> <?php $tarali_query = new ...
1
vote
0answers
84 views

ACF Plugin - Dropdown menu of Posts based on Date Picker range [closed]

I am building a website with a Custom Post Type, "Events". I would like to use the Advanced Custom Fields (ACF) Plugin to provide custom fields for this post type, 2 of which will be ACF Date Picker ...
0
votes
3answers
140 views

Display content from a specific category

I'm trying to get my news page to display content from one category only (number 3) but I cant seem to get it to work. Instead of just displaying posts from category 3 it displays posts from all ...
0
votes
0answers
27 views

Plugin: Posts 2 Posts problems with private posts

I'm trying to connect two private posts to each other and it doesn't work! but the same code work correctly for other published posts. Even if i connect a published post to a private post, in ...
0
votes
0answers
69 views

WordPress multisite custom query pagination issue

I have a site with a query to grab by a particular category. The current site is also running a multisite system. Before upgrading to 3.9 this query worked fine, but after updating to wp 3.9 & ...
0
votes
2answers
89 views

Nested WP_Query breaking loop

I'm using WP_Query to get all pages without subpages. For each page I'm using again WP_Query to get all child pages of the current page inside the first loop. This all works fine and I'm getting the ...
-1
votes
1answer
360 views

How to Display Post View Count

I am trying to display post view counts. I've tried below function to display the post view count, but I'm getting same post view for all the post in loop. Not getting correct post view count. ...
-1
votes
1answer
41 views

show custom post's post in two different divs [duplicate]

I have created a custom post type. For that I have used this code add_action( 'init', 'broker_post_type' ); function broker_post_type() { register_post_type( 'new_broker', array( 'labels' ...
0
votes
0answers
60 views

Query Distinct Taxonomies of Custom Post Type

I have a custom post type called "coupons". These coupons can then be drilled down by "city". City is a custom field that is defined for each individual "coupon". I am then trying to modify a sidebar ...
0
votes
2answers
39 views

Proper syntax to add boolean in array()

Conditional php question... I have an array and need to add an OR boolean to check for an additional category 4. Don't know the syntax to use for adding more category id's. I've tried array('cat' => ...
0
votes
1answer
31 views

Browser Cache causes 'Orderby=rand' to return the same posts

I have a code that redirects users to a random post whenever they visit the homepage: if (have_posts()) { query_posts('orderby=rand'); while (have_posts()) { the_post(); ...
0
votes
1answer
94 views

Adding div after every two post on main loop! Why will first post not get counted?

So I am trying to add a div after every two posts in home.php and I almost followed the answer found here but changed it a bit to function with the rest of the theme. Now the problem is that in the ...