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
2answers
31 views

Get post ids from WP_Query?

Is there a way I can retrieve an array of post ids queried from the following: $latest = new WP_Query( array ( 'orderby' => 'rand', 'posts_per_page' => 3 )); if ( ...
0
votes
0answers
28 views

Display page content inside a onclick popup or fancybox or lightbox

I'm doing a single page theme. So in that I would like to have some links which load the page content of the page inside a fancybox or lightbox. I've already tried Best way to load page content in ...
1
vote
1answer
24 views

Inserting custom data to the_post() during loop

I have some posts on my WordPress site, and let's say I want to add a random number for each post with $num as key and random() as value. Then I want to access them with something like: $post->num ...
0
votes
1answer
17 views

How to get only current images of a post

I am new to WordPress. I have created a template page where I want to show single posts, So to get media of that post I am using a function $args = array( 'post_type' => 'attachment', ...
0
votes
2answers
77 views

Order by meta value, pro first, then free

query_posts($query_string . '&meta_value=pro&orderby=rand'); I get pro list with random, but I want pro as well as free, but with pro list first, then meta_value free list. I also set ...
0
votes
0answers
30 views

Ordering posts alphabetically by meta keys and title

I have a query for custom posts and I have managed to order the results alphabetically based on the title first then a 2nd alphabetical ordering of the 1st of 2 meta keys "Species". This works great. ...
0
votes
0answers
16 views

Set post count to count only author posts

I have tried to reset the count to only show the current user's posts if they have the role contributor (I created a new role based on contributor called student_role). My problem is that it works in ...
0
votes
0answers
12 views

Query Post Using Date custom field which has series of dates

I am working on a golf course booking website. The booking dates are stored using a custom meta box in a textbox like this 2014-09-26, 2014-09-29, 2014-10-01, 2014-10-05, 2014-10-06, ...
0
votes
1answer
36 views

Posts per Page on custom Taxonomy Template

I'd like to show 20 posts on my custom tax template, using this filter: function customize_customtaxonomy_archive_display ( $query ) { if ( ( $query->is_main_query()) && ( is_tax() ) ...
0
votes
0answers
28 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
16 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
46 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
19 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
45 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
148 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
79 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
14 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
51 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
39 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
38 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
83 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
42 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
27 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
25 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
22 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
32 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
83 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
30 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
169 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
19 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
25 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
53 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
86 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
62 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
11 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
63 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
83 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
65 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
25 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
34 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
51 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
62 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
94 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
26 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
18 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
41 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
95 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 ...