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
1answer
903 views

WP_query parameters for date range

I'm using the events manager plugin to create custom posts for events. I do not have a need for a blog, so I modified my theme's index.php file (using a child theme) for its query to retrieve the ...
0
votes
0answers
181 views

Advanced Custom Fields Post Object

I am looking to create a custom proposal system with WP and ACF. I created 3 custom post types. Proposal Objectives Proposal Items Proposals I created some custom fields in ACF to include in ...
1
vote
2answers
57 views

Integrating post archive wtih another source and preserving date ordering

I'm pulling posts from Instagram into the WP basic archive view; but I want things to display in order of date, and not screw up paging (too much). The outcome should look like this: BLOG POST JUNE ...
0
votes
0answers
195 views

Turning wp list categories into a dropdown menu

I am creating a custom dropdown for my wp site and I am running into issues. I have a taxonomy set up called 'types', these can be filtered in a nav at the top of the page and they link to the right ...
0
votes
2answers
27 views

wordpress taxonomy query posts

I have categories and sub -categories with same name.. but I want to show only the categories which is on the top level and not in the sub categories $qry=query_posts( array( 'post_status' ...
0
votes
1answer
112 views

Passing a varible from jQuery to PHP

I have a a bunch of li's that are a blog but i want to show them enlarged in a colorbox. Therefore I need to know which li I clicked so I can get that ID and use that in my query to get all the date ...
0
votes
0answers
120 views

Listing Subcategories with post titles underneath

When viewing a parent category page, I am trying to list its sub-categories with each post title (max 5) underneath. I have managed to put together a code that lists sub category titles and I have ...
0
votes
1answer
52 views

Pagination linking to first page

I have created a query which work correctly and displays the pagination correctly. However when clicking the links /products/category/application-range/page/2 the page will load and go back to ...
0
votes
0answers
285 views

Filter posts by multiple checkbox categories

I would like to set up a widget to filter my post by categories. Let's say, I do have two different categories, "Countries" and "length of stay" with sub categories. Here is an example of what I have: ...
0
votes
0answers
28 views

complete show post older 10 post

i want show random post older 10 post i used this code for show 5 random post <?php $args = array( 'numberposts' => 5, 'orderby' => 'rand' ); $rand_posts = get_posts( $args ); foreach( ...
2
votes
1answer
234 views

How to implement time filter to show random post 1 month for one category and 3 months for other categories

I started to work on one website after another developer and there is problem with his "popular widget" which is basically showing 3 random posts from category. There is some Switch statement which is ...
0
votes
1answer
159 views

How can I change the publish date based on a custom field?

How can I change the publish date based on a custom field? Author uses a date picker to choose the date for journal entry. The date is used to make a list of all the users journal entries. I can ...
-1
votes
1answer
37 views

query posts in wordpress

I want to filter my query results just before the_loop starts in word press. I only want the results having term_id or term_taxonomy_id equal to 1. ...
0
votes
1answer
104 views

Control content before and after custom post type loop

I am trying to create a left nav menu that contains a couple of different taxonomy lists of a custom post type. For example, the left menu might look like this... <h2>New Stuff</h2> ...
0
votes
1answer
43 views

Display Posts with template on a Page

OK, I'm sure some WP pros here will think this is a dumb question, and I'll probably get some flak, but I have actually read plenty of documentation, and I just don't think I'm even going in the right ...
0
votes
1answer
166 views

How to get alphabetic listing x other posts, based on first letter post?

Let's say I have a post called "Hello World" and I am on that page... Let's say I have different posts like "Haaaa" and "Hoooo".... What I want to do is showing Haaa and Hooo in a different place (let ...
1
vote
2answers
717 views

Display posts of the last 7 days

I'm trying to display the 5 best rated posts of the last week (7 days) on my website, however I can't seem to figure out how to display them. Here's what I've achieved so far but it doesn't seem to ...
2
votes
1answer
202 views

Can't show comments count per post outside loop

How can I show the amount of a comment per post outside the loop? I tried this in a function already: ' . get_comments_number . ' , but that outputted the text "array" on the screen... What do I have ...
3
votes
1answer
3k views

Get posts from sites in Multisite?

I'm trying to pull multiple sites posts. For example, I can pull out a single site posts by a category and total posts 10. But I'm trying to pull out both posts from two separate Multisite blogs 1 ...
0
votes
2answers
132 views

query_post and wpdb returning different results

I am trying to get the woocommerce products by category.. When I query using the wpdb it gets the product correctly which exists in the backend products list. But when I query using the query_posts it ...
1
vote
1answer
332 views

Perform query with meta_value date

I am trying to perform a query on a custom-type post using the value of a custom field. This field contains a string date: dd.mm.yyyy. The post type name is 'event' The custom field name is ...
1
vote
1answer
125 views

Change order of posts

I made a post recently that did not explained myself right! Come again, but with better explanations. I need the "Select Option" change the order of query_posts. My current code is: <select> ...
9
votes
4answers
252 views

Is there a way to exclude the content from the post variable to save on RAM usage?

So, I've run into what looks like a WP RAM usage problem and am looking for a solution. The only place I'm really having this problem on my site is with a Site Map page that I'm trying to populate, ...
0
votes
1answer
158 views

Restrict query_posts by Date?

To display the most popular posts based on page views I am using this code (source): <?php query_posts('meta_key=post_views_count&orderby=meta_value_num&order=DESC'); if ...
1
vote
2answers
126 views

Trying to find a way to query post like normal search would do. within search.php page

I have a costume search in a site i am making. When a user search a certain term, i want to display category list with a count of how many posts are found with in that category. I thought of a way ...
0
votes
1answer
299 views

Transfer taxonomy to custom field

I have a blog with movie critics and I'm using many taxonomies to add some informations about the movies, like director, actors or it's year. Using taxonomies is really useful to display all movies ...
0
votes
1answer
168 views

Replace query_posts with pre_get_posts

I have a static front page that checks if the user is logged in, and if he/she is a number of x posts from a specific category is displayed. For that I was using this code: ...
0
votes
1answer
107 views

Multiple post queries -category,posts per page,orderby

I originally had this query on a posts category page: <?php $page_query = new WP_Query('post_type=post&cat=145'); ?> Which worked, but it only displayed the first 4 posts. So I ...
0
votes
1answer
386 views

Copy posts from one blog to another in multisite environment

I am creating a plugin for post.php page where user can select (one or more) blogs and copy the post content,title,author,categories everything in selected blogs. The copied post would be the child of ...
1
vote
1answer
459 views

Using loop pagination on single.php

I want the main front-page loop to show in a section on both index.php AND single.php templates, with pagination. Pagination works fine on the homepage, but not on single posts. This is the code ...
0
votes
1answer
79 views

Exclude current sticky post

I have the following query, trying to fetch the latest sticky posts but exclude the current one: $sticky = get_option('sticky_posts'); rsort( $sticky ); $sticky = array_slice($sticky, 0, 3); ...
1
vote
2answers
341 views

Next/Prev posts on same page

Hello WordPress Users, I'm stuck with a problem building my wordpress website and I can't figure out what to do about it. Currently I'm showing 2 posts form the category 'News' at the page 'News'. ...
0
votes
1answer
45 views

Different layout based on post amount?

Is it possible to change the layout of the query posts depending on how many there are? So simple query page listing posts... Up to 4 posts show them in a list. If there are 4 posts and over show ...
0
votes
1answer
201 views

How to break up php code to avoid echo

I have this php code I am using to list all post (titles) with the taxonomy categories names, and its working fine however I will like to break it up and avoid using echo within the php code so that I ...
0
votes
1answer
48 views

PHP dynamical conditional post display

I'm trying to get the WordPress loop to display only the post has an ID that reflects whatever $category_name is equal to, as shown in the line of code below. It ends up showing everything and not the ...
0
votes
0answers
44 views

Displaying posts by year

I'm trying to display posts on the homepage from the current year only. I am using the following: <?php if ( is_front_page()) { ?> <?php $current_year = date('Y'); ?> <?php ...
0
votes
2answers
79 views

Query posts based on parents attribute

This is the scenario: I have multiple pages that all have a custom field named "Location" Those pages all have child-pages with the custom field of "size_m2". What I want is to do a normal meta_query ...
0
votes
1answer
69 views

Query for first 3 posts to change the look and feel

Is there a way to query for the first three recent posts and then change how they display on the front page? I want the first three posts of my blog to show differently than the rest of them i.e. ...
0
votes
1answer
36 views

Show the latest post from child category?

How do i show the latest post from a child category? I have the category Photos, but I want to only show the latest post from the Child category "Paparazzi" what do i add to the code below to do ...
0
votes
1answer
144 views

Query specific posts per user selections from dropdown menus

This may be a little different than most people do. I'm trying to show certain posts that are determined by 4 different "categories." I have a large database table full of "products" (I'm using the WP ...
0
votes
1answer
367 views

Show individual author rank from query of cumulative post view count for all authors

I originally was going to post a question on how I would go about ranking a list of authors by the amount of post views from all of their posts combined. But I luckily found a solution here: List ...
0
votes
0answers
49 views

Combining Custom Tax Conditionals and Custom Querys?

The following has a custom post type of features, within that a custom tax called feature-type with three categories, template-1, template-2 and template-3. Each custom post feature needs to select ...
0
votes
0answers
44 views

Pagination for blocks with custom post_queries

I tried many of pagination functions but no one is working good. They all display page count and link to page but when I click on the link no result. Nothing is changed except browser's adress link. ...
2
votes
2answers
212 views

Query for posts in 2 taxonomies

I am currently using the following code to display a list with links to posts in a specific CPT and taxonomy: <?php $custom_terms = get_terms('videoscategory'); foreach(array($custom_terms as ...
0
votes
1answer
340 views

Posts of specific category on page and excluded from index.htm

hope things are going well. I'm trying to create a member's only section specific for posts of about job opportunities. My goal is to have posts of this category displayed on this page and excluded ...
0
votes
1answer
82 views

Checking if field is set before comparing with meta_query in query_posts?

I have a query set up to compare the start and end dates for some custom fields. The start date is required for the post; however, the end date is not. This causes some issues with the following: ...
0
votes
1answer
126 views

wp_query select if have comments

I previously asked and accepted a similar question here: wp_query and comment_parent - select only posts with top level comments So I'm trying to use wp_query to select only posts that have comments. ...
0
votes
1answer
146 views

Display Posts Query with IF function

I'm writing a template to display my custom posts types in a list. But I only want to have the post show if it has a value for one of my custom fields. I'll explain: My custom post type is "Faculty ...
0
votes
1answer
125 views

Custom query shows custom post types in trash

I have a custom wordpress query like so: $query = new WP_Query(array('post_status' => 'future || publish', 'post_type' => 'kalender', 'order' => 'ASC')); But the problem is that the items ...
0
votes
1answer
388 views

filter posts by meta key with pagination

Trying to filter out specific posts that have certain meta_key from the main query... problem is it doesnt work with pagination which is my issue here. Anyone knows how to solve this? $paged = (end( ...