0
votes
0answers
49 views

Passing query variables to a custom page template

On my website I have a custom post type called 'theme'. I wanted the homepage to display an archive of themes. For this the only approach that I could think of was to create a page template with a ...
0
votes
0answers
26 views

How do I enforce a 404 status for an EXISTING page?

I was able to replace the main query for 404 pages with pre_get_posts but as soon as I point to an existing page, the error changes to 301. What function should I hook to to change the status to 404 ...
1
vote
1answer
25 views

How safe is renovating $wp_query when doing WP_Query pagination in Page Template

With a lot of search and trial&error, I's unable to do the pagination in a custom page template. I's not actually tired, but frustrated, why the most common err issue is not explained in a way so ...
0
votes
1answer
356 views

How to create Page templates for showing Blog posts in different layouts?

I'm creating a Wordpress Theme, and I want to create few Page Templates for creating Blog pages with different layouts. So for example, I want to have blog-4-column.php, blog-3column.php and ...
0
votes
1answer
28 views

Run next query based on first query's term

I'm creating an authors site. I'm using a custom post type (Books) to display books. I'm using another custom post type (Reviews) to display reviews on the same page as the corresponding book. I'm ...
1
vote
2answers
357 views

Display Posts of a Category in Alphabetical Order (Custom Post Type)

I have a custom post type called "link" I have a custom taxonomy for this post type called "link-category" I have a template file for this taxonomy, "taxonomy-link-category.php" I need the template ...
0
votes
1answer
110 views

Custom Page Template Category loop not functioning correctly

So after several attempts to correct this - It seems the pages not load but don't pull in the correct posts from each category. It just seems to pull in the same default posts whenever I click each ...
1
vote
3answers
170 views

Single page theme

I am trying to create single page theme. What i have trouble with is understanding this whole wordpress query logic. There is query object and supposedly i get all published posts like this: ...
0
votes
1answer
43 views

When importing a database any page with a wp_query in doesn't work

I've noticed this a lot, when I export a database from a test site and import it into a live site, any (or most) page with a wp_query in it doesn't show up correctly (It shows the theme, but as though ...
1
vote
1answer
2k views

Display all posts for taxonomy term across multiple custom post types

I'm currently creating a website that uses several content types, (e.g. books, movies, shows) as well as a key taxonomy term (e.g. status, with values of owned and wishlist). My question is, in a ...
1
vote
2answers
13k views

How to display page content in a page template?

In my WordPress site, I made a custom page template, which contained a custom query [using WP_Query()]. With that query, I can perfectly get the posts of a certain category. But I want to show the ...
0
votes
1answer
139 views

Paginated WP_Query doesn't return 404's, even when posts don't exist

I'm currently building a theme for a client, and one of their requirements is endless scrolling on a "Charts" page. They want this to be paginated, and the endless scroll to load the next page below ...
1
vote
2answers
1k views

Custom-Posttype & Custom Taxonomy WP_Query

I add a custom post type with custom taxonomy and i wish to get all postings into this by a template, but the result is 0 $args=array( 'post_type' => 'contents', 'post_status' => 'publish', ...
2
votes
3answers
408 views

What are the differences between “Latest Posts” and “Static Page”?

WordPress has an option to pick "Latest Posts" and "Static Page" under "Settings" in Admin Panel. My questions: What page template is getting loaded in each of those modes? Why paged stops working ...
1
vote
2answers
464 views

Single page theme that uses pages for the content

I'm making a one page site. On the page I want to run WP_Query three or four times to pull in those 3-4 pages. The page looks a bit like this: <div class="row"> <?php $args = array( ...
3
votes
1answer
1k views

Dynamically link to the latest post or simulate request of specific post in page template

I want to have a link in the wordpress menu pointing to the latest post of a specific category. Because I am not able put a dynamic URL in the wordpress menu, my approach was to put a page with a ...
0
votes
2answers
2k views

Pass $page_id to new WP_Query

Probably pretty simple and more PHP-related than pure WP, but how would one pass the $page_id generated in the first code snip into the new WP_Query () in the second code snip? What I need to do - in ...
0
votes
1answer
190 views

Having trouble using this post category query on multiple pages?

I have three pages on my site (Listen, Read, Watch) which each query a different post category: "listen", "read", and "watch" respectively. I created three separate php files with their own unique ...
0
votes
1answer
46 views

odd behaviours from template tags

Some of my template tags are playing up, and they have left me confused. On one site, that has been live for over a year without any of these issues, on all the pages that have custom query loops, ...
0
votes
3answers
479 views

Page template doesn't display simple HTML if inserted into other page?

I've created a super simple contact page template, just content and a contact form, like so: <?php /* Template Name: Contact */ ?> <?php while (have_posts()) : the_post(); ?> ...
1
vote
1answer
113 views

How is WP_Query parsed to determine which template to request?

I noticed that when I changed the WP_Query to ask for a certain category, the page served was category.php. So I'm guessing there's a block of code somewhere that decides which template to serve based ...