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
15 views

Sort Posts By Custom Field Date

I know it's not a new question, but everything I found fails to sort my posts. I simply want to sort 30 posts that have a custom field, let's say "album_date_sort", by the date entered in its value. ...
0
votes
0answers
13 views

Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?

I have the following problem with featured tag posts I have a page of a website in wich I want to show only the posts that have setted a specific tag (using the loop). So in this page I have put ...
0
votes
0answers
13 views

Why I have this strange behavior when I try to exlude the featured post from posts visualization?

I am quite new to WordPress theme development and I have a strange behavior with this custom theme on which I am working: http://lnx.asper-eritrea.com/ As you can see in the home page I have 2 areas ...
0
votes
0answers
38 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: ...
0
votes
0answers
16 views

Query_post does not get the post_content

When I use before a loop query_posts( '%cat=4'); I get everything, including the post_content field, but when I use the code from here: http://codex.wordpress.org/Function_Reference/query_posts ...
0
votes
1answer
24 views

Get postlist for each category using query_posts?

<?php $cat_name=array('Breaking News Stories', 'Call-out', 'Featured Story', 'Standard Stories'); $count=count($cat_name); /*Get category_id by its name*/ for($i=0; $i < $count; $i++) { ...
0
votes
2answers
31 views

Warning: urlencode() expects parameter 1 to be string, array given in and not getting the preffered output

Warning: urlencode() expects parameter 1 to be string, array given in D:\xamppp\htdocs\sample\wp-includes\formatting.php on line 3690 When I try to give the category_name in the query_post, ...
0
votes
1answer
67 views

query post limits

function posts_limit_fn($limit, $query, $custom_limit = ''){ if($custom_limit !== ''){ return $custom_limit; } return $limit; } this piece of code is executed into an AJAX ...
0
votes
0answers
7 views

How to customize page navigation to different query_posts

I work on category.php For the first page i want to show posts under premium category and [the clicked category link] so i used the query post: category__and' => 4208,$cat_id Then when clicked NEXT: ...
0
votes
1answer
36 views

posts_nav_link on single post template

I have a post type called journal and on the single-journal.php template I am querying the rest of the journal posts like so: <?php query_posts( array( 'posts_per_page' => 4, ...
0
votes
0answers
30 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
28 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
49 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
28 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
16 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
24 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
23 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
25 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
16 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
29 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
vote
2answers
55 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
28 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 ...
1
vote
1answer
140 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
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
21 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
41 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
72 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
59 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
10 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
44 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
55 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
57 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
18 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
33 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
40 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
48 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
82 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
21 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
17 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
35 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
81 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
54 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
20 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
41 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
66 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
59 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
37 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
38 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
100 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 ...