A generic term referring to the process of retrieving information from a database.

learn more… | top users | synonyms

0
votes
1answer
24 views

Get previous posts list

I'll give up. Have searched and searched and tried and tried... Can't find any solution to list previous posts. On a single post: I want to show a list of the 10 previous posts, the 10 before the ...
0
votes
0answers
17 views

Displaying Taxonomy titles with their post

Suppose i have a taxonomy note_navigation like this Class 11 --Science --> THis is children of Class 11 ----Physics --> Children of Science and grandchildren of Class 11 ------ QUantum Physics ...
1
vote
2answers
85 views

Query string parameters from custom fields, inconsistent results

I've got a custom post type called course. Within a course post, I have a number of custom fields, specifically (all AFC select dropdowns): course_or_project, time_to_complete_project, ...
0
votes
1answer
22 views

Creating a custom search for a specific post type

Ok, so we know Wordpress comes with a built in search form. However, I've created a custom archive page that lists posts from a specific post type. I would like to integrate a search box that only ...
0
votes
1answer
18 views

Custom pagination (Title, date and teaser)

I'm working on implementing a custom pagination for a website. Unlike default Wordpress pagination with "Older" and "Newer" links, this one requires to show the title, the date and the teaser of the ...
0
votes
1answer
17 views

Mark a page of a queried menu as active

Im trying to mark as active a page of a queried menu --> (I found the answer) function render_main_menu(){ $args = array( 'post_type' => 'a_cpt', 'tax_query' => array( ...
1
vote
1answer
12 views

My SQL function to change user_name

My wordPress database was hacked and all users_names were changed to the same thing. I'd like to write a mySql query to replace all usernames that = "x" to the user_nicename. I'm unsure how to do this ...
0
votes
1answer
49 views

Query Custom Post Types with checkboxes

I have Custom Post Type (Courses) with a field "course-location" that is a checkbox. I would like to filter the listing page with the checked items. The below code is working when I select ONE ...
1
vote
1answer
52 views

How select a specific query when setting offset?

In wordpress I added a function which sets the offset like so: add_action('pre_get_posts', 'myprefix_query_offset', 1 ); function myprefix_query_offset(&$query) { if ( ! $query->is_home() ...
-2
votes
1answer
44 views

Custom Query for wp_posts using wp_postmeta

In postmeta lets say meta_key = 'count' and meta_value = '5' meta_key = 'count' and meta_value = '6' meta_key = 'count' and meta_value = '7' now i want to get all post WHERE meta_key = 'count' ...
0
votes
0answers
25 views

Display result from custom post meta query

This is driving me crazy! I'm trying to simply echo the contents of a meta field (twitter) from the wp_postmeta table of a custom post type with the following query outside of the loop : global ...
1
vote
2answers
57 views

WP_Query Authors OR Categories

I'm trying to create a feed where posts are pulled based off a set of authors, OR a set of categories, but I haven't had much luck. I've tried using meta_query and tax_query, but neither worked. ...
0
votes
0answers
42 views

Standard WP_Query Returns No Results

Edit: found the problem. The fields I'm trying to filter on are custom fields. They were created with the "Load value based on the post's terms and update the post's terms on save" setting UNchecked. ...
0
votes
0answers
18 views

Custom Query Problem

I want to get posts specified with just parent category, not with childs of it. But when I'm using category property, posts_per_page not working. If I remove category proerty, posts_per_page working. ...
0
votes
0answers
22 views

Filtering by custom fields select?

I have a custom template listing all the posts under a category x. This is how my current loop looks like: <?php query_posts('cat=522'); while (have_posts()) : the_post();?> All the ...
0
votes
1answer
41 views

Using URL variables on a custom WP_Query

Background I have a page with a custom template 'listen', with a custom wp_query running on it... $custom_query_args = array( 'post_type' => 'post', 'tax_query' => array( ...
0
votes
1answer
29 views

Style Post Differently In Query

Hi I'm using the query below to display 7 post from a certain tag, but I'm having a problem. I want to style the first post one way and the next 6 post differently. What I have noticed is that it ...
0
votes
1answer
18 views

Show certain number of post from tags

Hi i am using the query below to display post from a certain tag term, but what I want it to show multiple post. So far the query is displaying only 1 <?php $args = array('tag_slug__and' => ...
0
votes
0answers
30 views

Too many categories drastically slow down my website

I'm building a WordPress website that needs something like 7.000 categories. I added them, but now I have very long loading times. Pages need something like 30-40 seconds to load completely, and I'm ...
0
votes
1answer
32 views

How to fetch meta_value and meta_key in matrix after ajax request by post_id

Well, I have 2 custom post types: A = Properties B = Property Owners Inside CPT Properties, I was created a Meta Box to: Search a registred Owner (CPT) by VAT number (CPF in Brazil) Relate Owner ...
0
votes
0answers
14 views

How to use query on pre_get_comments?

I'm trying to make a search field for comments but when I try to modify the query in pre_get_comments nothing changes to the output. This same way IS working with pre_get_posts but for some reason I ...
0
votes
1answer
47 views

Help ordering custom query by Title, Ascending

I have an old project (custom post type query) that needs an alteration and my memory/skill level is lacking for what to do. With the code below, I'm needing to return the first query in alphabetical ...
0
votes
2answers
39 views

Write WP Query that selects posts that are part of the same two categories

How would I go about writing an intersect query (using WP Query) that returns a set of posts that are in both category A and category B?
0
votes
1answer
33 views

Show last 12 uploaded images on home page, but only from posts

I want to show the last 12 images that were published with articles on my front page. This is the code to get the latest 12 uploaded images, but i want to show only the ones attached to a post ...
0
votes
1answer
76 views

How to get posts from many categories using WP_Query

I'm trying to get posts from multiple specific categories. This is my code: $myquery= new WP_Query( array( 'posts_per_page'=>7, 'cat' => array(5,3,7), ) ); It isn't working - what am I ...
0
votes
1answer
30 views

How to add parameters for custom post type

I need to add a parameter to this custom query below. post_type=customer-stories&tag=microsoft,google I now need to add a parameter that will allow me to customize how many of each type of ...
0
votes
0answers
27 views

Ordering Posts by parent category, name ascending

I am currently creating a theme, and I have 2 parent categories: Budget and Brand. On home.php, I want to order all the posts ascending by their sub category name without showing the category title. ...
1
vote
1answer
14 views

What's the equivalent of Hide From Menus on MODX on WordPress?

In MODX, there's a checkbox on posts that will hide it from the main navigation and the post query. This is a very good way of making the post private for reviewing or simply having the post ...
-2
votes
2answers
70 views

How to display search query as formatted text?

I am trying to display a site vistors search query on the search page. The form has custom fields so is not showing if it's "Search" and it doesnt show none of my custom fields. My search form - ...
0
votes
1answer
68 views

How to get category link without a database query

I use Wordpress 4.3.1 with PremiumPress Business Directory Theme. The theme's homepage renders a list of categories using code that's basically: $args = array( 'taxonomy' => ...
0
votes
1answer
58 views

Loop through incrementing custom fields

I created 4 custom fields for a specific page. Field type: Post Object (I grab thumbnails and titles from the posts) Field names: featured_content_1 featured_content_2 featured_content_3 ...
0
votes
1answer
59 views

Looping Through Custom Tax Terms and Displaying All Posts For Each

I'm using the following code to attempt to loop through each of the terms within my custom taxonomy category-film and then output the term name as a heading together with displaying all the custom ...
1
vote
1answer
60 views

Error when using setup_postdata()

I am trying to get the most recent and show it using the native function (e.g. get_the_title()), do NOT want to use $post['post_title'] but when I do this I'm an error. global $post; $featured_post ...
0
votes
1answer
25 views

empty query breaks other queries

Hi I have a cpt query which displays 1 latest event based on date. It works fine - problem is when date is < today (theres no future events to display) this query is empty and also breaks other ...
0
votes
0answers
46 views

SQL Query to export Buddypress Profile data

I need to use sql query to export for http://wpdatatables.com, the code the plugin generates comes with error and I've tried phpmyadmin and sql pro with same error SELECT wp_bp_xprofile_data.value, ...
0
votes
1answer
32 views

Wpdb empty result only if language is Russian

I'm having a little problem with wpdb query. I need to change content of an HTML select by changing another one ( simple and clean ), so, this is my query: $_queryString="SELECT ...
1
vote
1answer
68 views

post loop causes wp_users and wp_usermeta DB queries for each users

Continuing my previous question: My post loop produces 2 queries per post: SELECT * FROM wp_users WHERE ID = '53' require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), ...
1
vote
1answer
78 views

Date query year and month OR just year

I am a bit stuck with setting up this date query. I am using a dropdown select box to allow the user to choose which date archive they want to view. It works for the months, but when I select the year ...
0
votes
0answers
29 views

How to exclude child page on siblings and parent page in WordPress?

I'm trying to hide details about a child page when I'm on the siblings and it's parent page and I don't know how. What I made is exclude the child page details when I'm on it. I want to exclude the ...
0
votes
1answer
80 views

How to get thumbnail with pure PHP in a Wordpress database?

I need help to get thumbnails in a WordPress database with pure PHP because a need insert this in a Magento Application (Feed). Can someone help me? I need this: ...
0
votes
0answers
23 views

Query posts in current category but not attachment format

In my category.php i want to query posts in the current category but are not in post formats attachments. How do i achieve this? I currently have the below code that displays all the posts in the ...
1
vote
1answer
24 views

Query metas (and not : query posts by metas)

If I understood well, the WP_Meta_Query from Wordpress allows you to query posts by metas. But what I would like to do is to fetch metas; not posts. And I would like to fetch those metas without any ...
0
votes
1answer
20 views

Get multisite count without php?

I'm writing a program in Python that outputs information about Wordpress installations and I'm adding some features to detect Multisite installations and their details. I would like it to print how ...
1
vote
2answers
91 views

Query All users that has post

I have this query so far : $user_args = array( 'role' => 'frontend_vendor', 'orderby' => 'display_name', 'order' => 'ASC', ...
0
votes
0answers
76 views

Show posts by tags excluding current post

I'm having some trouble trying to display current posts by tags and not adding the current posts. Here is my work in progress and I'm using a custom post type. I'm not exactly sure on what to add in ...
0
votes
1answer
26 views

how to replace old DW site with new WP site? [closed]

I'm new to Wordpress.org. I have an old Dreamweaver website that I want to replace with my new Wordpress.org site, using my same original URL. How do I do this? I need simple, easy-to-understand ...
0
votes
0answers
105 views

How to get user by display_name with WP_User_Query

I'm using WP_User_Query to get user by display_name and other columns such as: user_login, user_nicename. Here is the code: $my_users = new WP_User_Query( array( 'role' ...
0
votes
1answer
51 views

Filter posts/pages by user_role array

I have made a code for to filter wich pages to show depending on your user_role. Everything was alright. But my customer created NEW roles with similars name/slug. So now, if some 1 have the role ...
0
votes
2answers
92 views

Query post for today, if no post get the previous one

EDIT : I answered myself. Simple request for you. I am trying to develop a code that search for post for TODAY. If it returns nothing, then get the latest post before today. For now, I have made a ...
1
vote
1answer
30 views

Storing Array from returned database query and using the array in a new query

I'm currently storing results in a variable from a db table like this : $followed = $wpdb->get_results("SELECT user_id1 FROM wp_um_followers WHERE user_id2 = 1", ARRAY_A); This returns an array ...