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.
1
vote
0answers
17 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
0answers
20 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
24 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
21 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
17 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 ...
-2
votes
0answers
32 views
Get all posts starting with first two letters in Wordpress
I have a plugin in which an alphabetical list is posted where people can click on a letter and they get the posts with that letter. So if they click on A, they see all post titles starting with the ...
0
votes
1answer
28 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
41 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
28 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 ...
1
vote
1answer
88 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
0answers
19 views
Getting post title and custom field in header? [closed]
I'm trying to get the titles(cities) and custom fields(phone numbers) of a category of posts (office locations) in the header of my theme.
This seems to be the problem area but I can't figure out ...
0
votes
2answers
35 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
35 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
votes
0answers
39 views
Isotope and query_posts
I'm experiencing an issue with Isotope jQuery and the Sampression theme.
I'm using a simple query_posts on my index page to view only one category.
It works fine at the first view, but when I click on ...
1
vote
1answer
44 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>
...
7
votes
4answers
126 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
29 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
48 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
232 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
40 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
23 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
54 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 ...
0
votes
1answer
92 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
48 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
47 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
34 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
54 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
26 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
23 views
is_front_page conditional problem [closed]
Either of these two conditions work by themselves, but when I put them in this if/else statement, I always receive an error:
Parse error: syntax error, unexpected '}' in ...
0
votes
0answers
27 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
45 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
22 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
22 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
77 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
202 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
23 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
29 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.
...
1
vote
2answers
67 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
73 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
52 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
46 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
0answers
15 views
child pages are not ordering correctly? [duplicate]
I have a custom post type.
I want to display them in the menu order.
e.g In backend i have something like
Post 1
Post 2
Post 3
child 1
child 2
post 4
Post 5
...
0
votes
1answer
73 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
23 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
82 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( ...
2
votes
1answer
28 views
Last posts from custom taxonomy
How can I post last posts from custom_taxonomy? I tried this like, but it doesn't works.
$terms=get_terms('tax_name');
$request=array();
if(count($terms)>0)
{
foreach($terms as $t)
{
...
0
votes
2answers
41 views
show posts from one category with comments only
Would anybody have a good idea for getting the WP to spit out all posts from a category with (approved) comments only?
I have an ecommerce site set up, and treat comments on product posts as ...
0
votes
1answer
87 views
Query Problem - Show posts within category 'x' that have a custom field between 'y' and 'z'
I'd like to display all posts within a given price range. For example: When a user inputs 100 and 1000 (in two separate form fields) - my site will display all posts that have a custom field called ...
1
vote
1answer
50 views
using post__in allow duplicate post id
I have an array of ids in a specific order. I use post__in in my query to get posts from this array. I have some duplicate post IDs that I need to show twice in the page but the query seems to ignore ...
1
vote
1answer
82 views
Custom MySQL Query with logic
I have wp e-commerce plugin installed and custom building custom global search
My query looks like this
SELECT * FROM aka_v_posts
LEFT JOIN aka_v_postmeta
ON aka_v_posts.ID=aka_v_postmeta.post_id
...


