0
votes
0answers
8 views

Search form not working on page templates

I have this on my searchform.php: <div class="search searchform" role="search" method="get" id="searchform" action="<?php echo home_url(); ?>"> <form action="#"> ...
0
votes
3answers
68 views

WP_Query fails despite having 1 post

I'm doing a typical custom post type query with args like this: array (size=4) 'post_type' => string 'custom_post_type' (length=15) 'post_status' => string 'publish' (length=7) ...
0
votes
2answers
30 views

posts_nav_link pulling in multiple post types

I have an archive-regularproducts.php set up that looks like so: PHP: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> //content goes here <?php endwhile; ...
0
votes
1answer
42 views

List sibling pages widget, exclude current page

I successfully created a widget that displays sibling pages to the current page I'm on in the sidebar. Only thing is, I'm not capable of excluding the current page - can someone please assist here? ...
0
votes
0answers
32 views

Query category-specific, paginated posts and allow viewer to change sort order

Maybe this has already been asked here, but I can't seem to find a solution, so forgive me if this is a duplicate. I have coded a custom template to display all posts from a category with the ID 36. ...
0
votes
0answers
23 views

Nested wp_query loop doesn't show connected posts

I have have a wp_query loop nested in another wp_query loop. The first loop queries the latest movies. The second loop queries the persons connected to each movie from the first loop (movies and ...
0
votes
1answer
27 views

Displaying Event within two given time frames

I'm trying to display two different posts from my CPT named Events. One is going to be the next event the other is going to be previous event. I've got a metabox called 'Event date' The client at ...
0
votes
2answers
47 views

have_posts() execution failure

I wanted to create a loop which displays search results in search.php file. I followed all of the instructions in the WordPress Codex tutorial located in here: https://codex.wordpress.org/The_Loop ...
0
votes
0answers
41 views

wordpress is_main_query() breaks

After upgrading to 3.9 the function is_main_query() breaks down and doesn't works the way we want The following code add_filter( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( $query ) ...
0
votes
0answers
27 views

Create WP_QUERY args with reference to my custom query

Sorry for my some different question. Can anyone help me to create WP_QUERY() arguments with reference to my following custom query? My query is as follows. SELECT SQL_CALC_FOUND_ROWS ...
1
vote
0answers
48 views

Configuring a meta query with multiple post types that have the same relationship on a single page

I am creating a client portal were my clients can maintain their projects and leave feedback. I have two custom post types called "Clients" and "Projects" and they each pull information from one ...
0
votes
1answer
36 views

Query seems to be duplicated

I'm just hit a development brick wall and can't seem to find a solution to this problem. I've running two WP_Query's the aim is one displays premium stockists and the other one displays the none ...
0
votes
1answer
50 views

Why does WP_Query show only the same post even with different categories and endwhile?

I have 3 divs that WP_Query with 3 different categories and end it with the php endwhile,but it only shows the same most recent post query three times over. Do I need to hard reset the query loop ...
0
votes
1answer
55 views

Remove Post if Advanced Custom Field is checked to fix paging

I'm trying to setup a query that filters through posts and removes ones that have an ACF field "archived" checked. Post queries are pretty foreign to me. ...
0
votes
1answer
85 views

Foreach loop returning more than one item when querying taxonomy

I am querying the taxonomy terms and then listing the posts that are under those terms. The taxonomy is basically a category for a custom post type, and the terms in it are the categories. I didn't ...
2
votes
2answers
111 views

How can i get the last post from wp multisite?

I have to get the last post from my Multisite network on WordPress. For now I use this code for display the last updated post after a cycle on each blog_id: <?php $blogs = get_last_updated(' ', ...
0
votes
1answer
17 views

allow previews outside wordpress folder (Outsourcing WP previews)

I am outsourcing the wordpress and I already figured out the external view. I even know how to make a WP query for previews, but when I want to do that I simply cant - wp-load stops all operations and ...
0
votes
0answers
72 views

How to get duplicate array count with custom post type

After printing array I am getting output like this: Array ( [0] => WP_Post Object ( [ID] => 8 [post_author] => 1 [post_date] => 2014-01-31 ...
1
vote
1answer
110 views

How do I “get the next 10 posts after post_id == x”?

I am building a mobile application that is pulling the json feed from a blog. I can easily query to get the latest 10 posts for example. But next, I want to be able to query the next 10. This presents ...
1
vote
2answers
128 views

How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field

I have searched high and low for a solution and couldn't find anything; hopefully someone here more skilled than myself can lend a hand. I have two testimonial videos (from a video custom post type) ...
0
votes
1answer
26 views

How to get category pages to look like a certain archive page?

I'm not sure if this question has been answered, I'm not sure of how i should have even worded this question but... I have a custom post type called videos and the style of the archive is different ...
0
votes
1answer
46 views

Is This Code Efficient - Or is there a better way?

I have a RECIPE WP site, that is using CPTs to handle the recipe content. The client wanted an A-Z Directory listing of all recipes. I came to Wordpress Answers and found the following code that ...
0
votes
0answers
95 views

Trying to combine multiple Wordpress queries

I am trying to query multiple post types and meta values in Wordpress... the query is trying to fetch event post types with a featured meta key, as well as post post types with the featured image set. ...
0
votes
1answer
49 views

Toolbar Hidden in a Virtual Page

I am trying to create a virtual page, but my admin toolbar is not showing up. This is how I am creating the virtual page: functions.php add_action('init', function() { ...
2
votes
1answer
154 views

is_page() not working from within a plugin

In my plugin I'm doing: function get_user_strains() { $userID = get_current_user_id(); $args = array( 'post_type' => 'strain', 'orderby' => 'post_date', ...
0
votes
0answers
25 views

General Guidance on how to delay validation of user profile custome field

I have a concept that want to apply to my Wordpress Theme. I want to add a costume field to registration form (easy, ok) the field can be filled later in profile, but must be field in 30 days, ...
0
votes
0answers
98 views

show/hide attachments

Is there a way to show/hide attachments in my case images on a post. What I want is to mark an image as "hidden" and then only show it to the admin and hide hidden images from a normal user I know ...
0
votes
1answer
135 views

Taxonomy Archive: Display only one post per term from separate custom taxonomy

I am having trouble coming up with a solution for product catalog I am building using custom post types and 4 custom taxonomies. The product catalog is separated by "model", but each "model" can have ...
0
votes
1answer
28 views

Custom Post-type not returning the right child_of

Situation I am using the Advanced Custom Fields plugin to give Custom Post Types a checkbox. If this box is checked, it should be returned by this Query. The Query works this far. The issue The ...
0
votes
1answer
126 views

Post Title Not showing up

Hi i'm using this code to call post from a certain category <?php $queryObject = new Wp_Query( array( 'posts_per_page' => 3, 'post_type' => array('post'), ...
0
votes
1answer
46 views

Advanced Taxonomy query, with 3 post types

I'm been trying to figure out how to do this for a few hours now and Have final given in to asking for help. I've got 3 custom post types that I need to query for a term called home which is inside a ...
0
votes
1answer
716 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 ...
0
votes
1answer
144 views

WP Query conflict on tag.php and category.php template

My WP_query in the header menu fails to pull any posts on tag and category pages only. Error occurs even with the Loop removed from those template pages. The menu in the header lists the parents. ...
0
votes
4answers
843 views

Accessing post->ID outside of the loop for listing child pages

I'm wanting to list child pages of my current page in the sidebar of theme. However my sidebar (left side) is before the loop in the template and the post->ID won't return anything if it's before the ...
0
votes
1answer
91 views

displaying a fall back query if there's nothing in the post-type category

I'm stuck trying to figure out the best way to manipulate my query so that if there's nothing in the category it will display the latest post-type. Here is the query I've got that pulls in the posts ...
1
vote
1answer
27 views

If Query In Sidebar

I'm trying to create a query that IF there is a value in the 'FeaturedQuote' custom field, then this shows <h3 class="featuredquote"><blockquote><span ...
0
votes
2answers
104 views

Create a Blog Template Page

I am trying to create a template that will display a list posts of a specific custom type. However, I am missing something fundamental. So far, here is what I have: functions.php add_action( ...
0
votes
1answer
301 views

reorder a WP_Query, using a dropdown

I have the following loop used to display posts by category & I would like to to re-order them based on a dropdown selector if (!isset($qry)) $qry = new ...
0
votes
2answers
597 views

Recent Posts slider, using WP_Query(), loads duplicate sliders

I have written a small piece of code for Wordpress that will show the most recent top 4 posts in a slider (the Filament Group Responsive Carousel). It works, displaying the posts and sliding them etc, ...
0
votes
1answer
3k views

Why WP_Query('showposts=5') shows only 1 post?

I am trying to do a simple query to get the latest 5 posts into an unordered list, but this is only showing 1 result even though I have several posts. I even did an offset, but it shows the next post ...
3
votes
1answer
142 views

Search widget breaks when using multiple loops?

I have created wordpress template that uses two loops via WP_Query object. Everything works fine except Search widget. I've been pulling my hairs out for three days now Googling like a madman,but ...
0
votes
1answer
320 views

Wordpress SQL JOIN query

Hi Im trying to run 2 querys in the same query call. // send the query global $wpdb; $commentQ = "SELECT * FROM $wpdb->comments " . $whereClause . $orderBy; $comments = ...
-1
votes
2answers
99 views

Fix incorrect related posts code snippet

Can anybody fix this incorrect related posts codes snippet? function related_posts() { if (is_single()) { global $post; $current_post = $post->ID; $categories = get_the_category(); ...
0
votes
2answers
165 views

WordPress theme options error

I am building a theme and I need to call theme options But I do get errors like white screen and 500 internal server error when I call theme options here In WP query (newbie in PHP) ...
5
votes
1answer
3k views

How do I use WP_query with multiple post IDs?

I want to query multiple posts with an array of IDs (note: I am querying a custom post type). Here's what I have, which isn't working: $myarray = array('144', '246'); $args = array( 'post_type' ...
0
votes
1answer
250 views

Using multiple variables to assign categories to an array

I have php set up in a template file to check a form and see if 1 or more of 5 categories is selected. Based on which one is selected, I want the custom query I'm using to change in that the array for ...
0
votes
1answer
166 views

Pagination not working on homepage

I tried multiple solutions but its not working. When I go to /page/2, it doesn't work. I'm executing custom query in index.php of my theme. if ( get_query_var('paged') ) { $paged = ...
4
votes
2answers
723 views

Build a content and excerpt grid loop with paging and options for # of posts

What I'd like to do: on index.php, a loop that shows a selectable number of full posts using the_content and then below that shows a selectable number (the number of posts can be hardcoded in the ...
0
votes
1answer
107 views

Query Custom Post Type by Tag

Kinda confused on this.. hoping someone can help. I have custom post type named "Providers" that I want to pull entries from that are tagged "highlighted". I enabled tag support on the custom post ...
0
votes
1answer
100 views

Search.php gets metadata from first post

I've got this in header.php in <head> section: $page_color = get_post_meta($post->ID, 'page_color', true); It works fine because it gets correct page_color for posts and pages but when I ...