A generic term referring to the process of retrieving information from a database.
0
votes
1answer
11 views
Query multiple custom post types in single loop
I'm aware there are several other posts that cover similar ground to what I'm about to ask.
I have three custom post types running, in addition to 'posts'. I want to run a loop that pulls all posts ...
2
votes
2answers
1k views
Get category slug and display it on a query_post
I just read "How to create option page for wordpress theme" in wp.tutsplus.com - I have a problem with getting categories .
there is two parts to my question
- Part A - Get category slug and ...
0
votes
1answer
18 views
Get multiple posts with some custom fields efficient
Is there an efficient way to get some posts with (some of) their custom fields in one go?
I have a custom post with some custom fields and would like to create an overview page where I display all ...
0
votes
1answer
42 views
WP-Snap too slow (caused by WP_Query?)
I have a website with 10.000 posts... WP Snap alphabetizes the posts and puts it out with WP_Query, but it is slow as hell, which is very frustrating. My question would be: what can I do about it?
...
2
votes
2answers
119 views
Rearranging posts based on categories
Hey everyone on Stackexchange!
I'm trying to find a way to prioritize posts based on a category in a loop, which is sorted by dates. All posts are grouped under their respective dates. The date ...
0
votes
3answers
39 views
Remove last comma from this query
I'm having trouble fixing this for working in ie8, i find out thats last comma is problem, but dont know how to fix it.
this is current code.
<?php $args = array( 'post_type' => 'katalog', ...
1
vote
1answer
720 views
How to display posts under a specific subcategory of a given category
after a long search online I have decided to post my problem here in the hope of getting a solution to this issue. Well, I have a custom post with various categories (novels, books, magazines etc..) ...
1
vote
1answer
15 views
How Can I Query a Specific Page From a MultiPage paginated Post
Let's say I have a post that has been paginated by adding the
<!-- nextpage -->
code provided by wordpress for this purpose. How can I then query a specific page from inside of that post. ...
0
votes
3answers
118 views
+150
Taxonomy Drill-Down / Plugin Help - hierarchical queries within plugin?
I hope this question doesn't make me look too stupid!
I am using a plugin called 'Query Multiple Taxonomies' -- it's a fantastic plugin and is written extraordinarily well. ...
0
votes
1answer
24 views
Custom Wordpress SQL Query 4 posts per custom taxonomy
I'm currently developing a Wordpress website that has a large navigation that lists the 4 most recent posts within a hierarchical taxonomy. I dont have any experience with $wpdb, but it seems like ...
1
vote
1answer
363 views
Sort posts based on multiple custom fields
I have a three custom fields
Meta Key → YOUR_PREFIX_newcar_body_type
Meta Key → YOUR_PREFIX_newcar_transmission_type
Meta Key → YOUR_PREFIX_newcar_variant
and I have to sort posts ...
0
votes
0answers
11 views
organizing taxonomies in custom post type
I created a custom post type named "Gallery" which contains photos in several taxonomies e.g: Sport, Nature, Food, Drink. I want to organize all those taxonomies in my page "Gallery". So I can see ...
0
votes
2answers
198 views
shortcode using multiple WP_Query's with multiple category names not fully functional
we're working on a bilingual site,
Larry A. Downs
all the posts are categorized into two categories, english or spanish, along with other categories. so every post has multiple categories,
i've ...
0
votes
1answer
111 views
How to add a prefix to existing custom fields over MYSQL query?
I've got the problem that after a plugin update I can make the custom fields on our directory site searchable, but only custom fields which get the prefix booking_ to them.
Now there are some pages ...
0
votes
2answers
117 views
Select min/max meta from query
Kind of lost on what to do here. I have a meta price for each post. I'd like to get the min and max price meta values of this search/query. At the moment its returning the min max values for all ...
1
vote
1answer
22 views
Searching With Apostrophe
I'm having trouble with my custom theme's search function. I have a number of posts with apostrophes in the title. For example, McDonald's.
However, when I try searching say McDonalds, the post won't ...
0
votes
1answer
36 views
How to display posts from specific category using get_option function?
I try to display posts from specific category only in a author page, using get_option function like in the code below but it does not work:
<?php query_posts('cat='.get_option('admin_cat')); ?>
...
0
votes
0answers
22 views
How to replace an ID with a get_option function in wordpress?
This is my code to retrieve the related posts from the same author in Wordpress:
<?php function get_related_author_posts() {
global $authordata, $post;
$authors_posts = get_posts( array( ...
0
votes
1answer
258 views
wp_get_post_terms Order by not working
wp_get_post_terms Order by not working
My code is here
query_posts(array('post_type' => 'product','post__in' => $product_ids,));
while (have_posts()) : the_post();
global $post;
$args = ...
0
votes
1answer
216 views
Load more posts with multiple queries
I've been developing a theme which uses the load more ajax plugin, everything is setup and working great with the main query.
But, once I setup a new query for popular posts, the load more posts ...
0
votes
1answer
46 views
How to use Greek characters/letters in a query?
I have a problem with Greek characters in a query.
Here is the code
Using the Greek characters in the 'meta_value' => 'Ναι' the query can't work, because of the language.
How can i make it work?
0
votes
0answers
29 views
Order custom fields by string length
I am trying to reorder a custom field from one of my Custom Post Types.
I'd like to get the custom field string which is called 'first name' and order all of the first names by their string length. ...
0
votes
3answers
22 views
search through post-type attachments titles
I have a page where I show all the attachments of a page in a table which has id=10.
I have hundreds of attachments and I would like to implement an AJAX search form that uses the title of attachment ...
0
votes
0answers
33 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 ...
0
votes
3answers
55 views
2 wordpress loops showing 1 post from same post type - how to avoid showing the same post?
I got to two loops in my template files. Both querying the same thing essentially.
This loop in my header:
$testimonial_head = new WP_Query(array(
'posts_per_page' => 1,
'post_type' ...
0
votes
2answers
17 views
New Wordpress WP Query using posts from certain categories
I want to display the last say 6 pieces of work from my portfolio. So i have written this query
<?php $the_query = new WP_Query array( 'category_name' => 'portfolio', 'showposts=6' ); ?>
...
0
votes
1answer
108 views
Pagination in wp query with transient api
I have intergrated wordpress transient system with w3 total cache. Now i can`t to do pagination for this query.
<?php
$paged1 = ...
0
votes
0answers
14 views
Pagination now showing on custom query? [duplicate]
I have a problem with the pagination. Using the custom query i can display the posts that i want but i can't display the pagination after the loop.
How can i display the pagination and make it work?
1
vote
2answers
55 views
Is there a conditional tag for latest post or do i need a query?
I need to display an avatar in the post info position which i have written the code for but i only want to display it on the most recent post on the home page and not a specific post as this will ...
2
votes
1answer
132 views
Show All Posts Insert Edit Link
When I click to insert/edit link in the tinyMCE rich editor for a post, then click "Or link to existing content", it shows only posts that are live and published. Is there a way to get the list that ...
-1
votes
0answers
25 views
Execute mySQL query on publishing of post
I would like to post some data to a db when certain categories are selected in a WP post. I would like this to action when the post is made.
This is the query I want to run:
mysqli_query( $con, ...
0
votes
1answer
257 views
create a link to a random post within the current category
I've got some code which creates a nice link to a random post - any way to amend it so that on a category page it selects a post from the current category?
thanks,
<?php
$randomPost = ...
1
vote
2answers
50 views
Optional Meta Query
I have places stored as posts in WP's posts table.
I am doing some geo-locating using Geo Data Store (http://wordpress.org/plugins/geo-data-store/). This is working great for me, as I can currently ...
0
votes
1answer
136 views
How to delete all posts, categories and tags from Wordpress database
I have WP website with over 40,000 posts. Now I'll like to delete all posts, categories and tags. So All content and related meta. All I want to keep is static files. Is there a easy way to do this ...
0
votes
1answer
30 views
How to callback custom field text
I have a plugin where the user can click a button to feature a post.
I added a text field but i want the text field to call back whatever is posted in it
Here is how it looks now
...
0
votes
2answers
1k views
Categories and products in random order
What I'm trying to do is getting Woocommerce categories and products randomly displayed on one page. The normal settings allow to display categories and products on the same page, but first come the ...
0
votes
0answers
30 views
Combine Query and Select Database to create directory loop
I have a query loop on my page that I am using which displays all users on the page with certain custom fields filled out. It's working fine however, I need to also query these users for their level ...
1
vote
4answers
64 views
Add a class to posts in increments of 2
Is it possible to add specific classes to posts/pages in a query in increments of 2?
For example
Post 1
Post 2
Post 3 (add custom class)
Post 4 (add custom class)
Post 5
Post 6
Post 7 (add custom ...
2
votes
1answer
71 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 ...
1
vote
2answers
876 views
Help with MySQL to $WPDB query
Here's my issue. I have three tables I'd like to query - states, points, and state_points.
States contains stateid, and name. Points: pointid, pointlat, pointlng. State_points: Stateid, Pointid.
...
0
votes
0answers
40 views
Marginal pagination on home.php
I'm trying too make a custom wp-theme and use a few loops in home.php. But now I can't finish home.php because of pagination. How cant I realize any type of pagination with saving that kind of ...
0
votes
1answer
394 views
Displaying Portfolio Filter by Category Order (alphabetically)
I have created a custom post type to display churches in Europe. I used this tutorial to make it filterable: http://wp.tutsplus.com/tutorials/creating-a-filterable-portfolio-with-wordpress-and-jquery/
...
6
votes
5answers
5k views
Wp get all the sub pages of the parent using wp query
Here is my code
$my_wp_query = new WP_Query();
$all_wp_pages = $my_wp_query->query(array('post_type' => 'page','post_parent'=>$parid,'orderby'=>'title','order'=>'ASC' ));
It displays ...
0
votes
1answer
218 views
How to retrieve attachments from child pages of a specific Page?
How would I retrieve attachments from all subpages of a specific Page ID?
Example:
SPECIFIC PAGE
Child (with attachments)
Child (with attachments)
Child (with attachments)
I'm currently ...
0
votes
1answer
37 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
110 views
Passing values by form to create a query
I have this structure:
taxonomy
- term1
-- child term1
-- child term2
-term2
-- child term1
-- child term2
I have two select boxes. First one shows the parent terms (term1 ...
0
votes
2answers
21 views
Find all posts via SQL beginning with A of type B
I have problem with post and taxonomy query. What i need is to get all post's from custom post type which starts with A and have defined term. Here is my sql:
SELECT * FROM $wpdb->posts, ...
0
votes
1answer
18 views
How do I add tags/taxonomy to images + a query field on page to query 'albums' (images with same tag/taxonomy)
I've got lots and lots of photos on my site and I want to seperate them into albums. Every album is a client album (photoshoot).
Though.. I want all my clients to query their album on my site. ...
0
votes
1answer
16 views
Show links to child pages on both parent AND child pages
I have a client who wants the following;
They have a series of pages, each of which have children. On the parent pages they want to show links to all the children. For this I am currently using this ...
0
votes
2answers
1k views
All in One Calendar Plugin Custom Post Type Query
Hi I'm trying to write a query which will pull the events out from the All in One Calendar Plugin. This is what I have so far:
<?php query_posts('post_type=ai1ec_event');?>
<?php while ( ...


