Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
18 views

Custom theme on multisite has issues with standard loop output

I am experiencing the following error output when using the standard loop on page.php and single.php on a multisite-based WordPress installation. The loops are the same for both template types, with ...
Mike Hermary's user avatar
0 votes
2 answers
592 views

First archive page with a few posts

I'm looking for a way on how to display only a few posts on a first page of my archive. This is my archive template — page-archive.php, which I am using as a template to display all my posts/recipes: &...
Alex Osipov's user avatar
0 votes
1 answer
285 views

Show only pages you are author of

I am trying to only show pages that a user is the author of for any role other than administrator. The code below seems to put the site in an infinite loop and it ultimately dies. add_action( 'load-...
Waterfall's user avatar
  • 105
0 votes
1 answer
24 views

Create a loop on my pages with new "WP_Query"

I wanted to loop through these four pages. Basically I would like my loop create a "li" by "page_id". I just know this is from my "new WP_Query" which is not good. How ...
Maximus's user avatar
0 votes
1 answer
313 views

How to use custom page for all posts with custom url, call another directory?

I have tried many different codes: <a href="<?php echo get_template_part( 'template/test/post' ); ?>"> Test 1</a> <a href="<?php echo ...
Akash Manna's user avatar
0 votes
1 answer
32 views

When and how will php code in a user made Wordpress page be executed?

What I have understood about what's happening when a web page in a Wordpress built web site is loaded is that Wordpress determines which post (page) and which template for that page to load. It then ...
Razzupaltuff's user avatar
0 votes
1 answer
70 views

Tags on page (not post) returns nothing - why? Improved clarified question!

Problem: I'm trying to echo tags to list items but only manage to echo the "else statement". Since this is about tags for pages I have added support for pages to show tags in functions.php: ...
Seblito's user avatar
  • 29
0 votes
0 answers
28 views

Template category.php with page (no posts)

on my home page I have clickable images that redirect me to custom pages. On each page, I've made sure I can assign categories. Now, I want to filter these categories by clicking on the button ...
Max R.'s user avatar
  • 11
0 votes
1 answer
249 views

Display page content in different sections - based on page break block?

Is there a way to loop through page content, and display the content that is above page break in one section, and everything that is below the page break in another? Or additionally, a way to generate ...
Rafał Jara's user avatar
0 votes
1 answer
42 views

How to distinguish pages created by woocommerce?

I am working on a theme and I have come to a situation when I need to distinguish the pages that are created by the Woocommerce plugin (e.g Shop, Cart, etc.). So far I've installed this plugin which ...
mtbno's user avatar
  • 101
0 votes
1 answer
59 views

Archive: Lists itself

So I have created an archive.php, set everything up, and my archive page works fine. Now I was wondering, of how I should prevent the archive page from listing itself. When accessing the page called ...
josias's user avatar
  • 195
3 votes
1 answer
82 views

Why do I need to use The Loop on pages (inside page.php etc)?

This question is addition to the following question. The answers to the linked question say that you have to write THE LOOP inside each php template file, but what is still open is WHY? why is it ...
GyRo's user avatar
  • 135
1 vote
1 answer
26 views

How i can add 'N' page of 'N' pages under posts loop?

I want show number of current page and count of all pages, near my posts paginations. I am talking about this
Денис Шишкин's user avatar
0 votes
0 answers
47 views

display the children of the post using the current page as the main parent

How can I display the childpages of my subpages on the main page using the main page as my first loop? I can display the child pages by inputing the subpages one by one but that is not practically ...
MIke's user avatar
  • 83
0 votes
2 answers
88 views

is it bad to copy the loop for a template?

I have created a page template to display specific data. Is it a bad idea to copy the loop from page.php and paste it as is in the template file? Does this mess with the loop? Doing this has made my ...
Jamie's user avatar
  • 1,363
0 votes
0 answers
506 views

Get current_post in reverse order with pagination

I'm trying to index my posts (in reverse) and I'm using current_count within loop to do this. This is my code: <?php $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $args ...
Karadjordje's user avatar
0 votes
2 answers
640 views

pages shortcode filtering by category

I've created a WP shortcode to list out pages which has controls to filter via category and also two layout formats. My issue is that the shortcode is not displaying all the pages that I have marked ...
Ryan Coolwebs's user avatar
0 votes
1 answer
85 views

Get top Page IDs from menu and cycle through their child pages on a scroller

I have a slick slider scroller on my home page that cycles through some of the pages I have on my main menu. I am using the following code to do this: <div class="page-scroller" > <div ...
Paulo's user avatar
  • 3
1 vote
1 answer
4k views

Remove child products from woocommerce category page [closed]

I have a taxonomy template that display products from both parent and child terms, how can I show only the products belonging to the parent terms? I'm trying to modify somehow this part of code: ...
Yury  Zheve's user avatar
0 votes
1 answer
1k views

Display child page content of a specific parent on home page

This has been bugging the hell out of me, it should be so simple! I have a list of child pages under the parent called 'Our Homes'. The sitemap structure is as follows: Home Our Homes home 1 home ...
Amesey's user avatar
  • 125
0 votes
1 answer
296 views

Problem with Displaying Custom Theme Page's Content

I've created a custom theme, and I want to display a custom theme page that I created, whose file name is page-about.php. The only way that I know that it's possible to display custom theme pages in ...
Gal Grünfeld's user avatar
1 vote
3 answers
8k views

How to loop through ALL pages?

Is it possible to loop through all the pages in a website? If so, how? I'm building a one-pager resume website, and I want to display all of the website's pages as parts of my main page.
Gal Grünfeld's user avatar
3 votes
1 answer
4k views

Loop with Dynamic Categories

I have a need to create a WordPress loop that displays all of the posts associated with a category, but I need that category to match whichever page I'm viewing. For example: Let's say I have ...
Nathan Alvarez's user avatar
0 votes
1 answer
2k views

Display Posts on Custom Page

I have a custom page template created for my homepage. I have this set to the Static Homepage under the Reading settings. I want to be able to show the last three news posts from my Blog page which is ...
Beau Beau's user avatar
4 votes
1 answer
2k views

Display subpages under parent page as a list within a loop

I'm looking to make a page template, which, if the page is a parent of children pages, then display them as an ordered list. I would preferably like to do this as a loop. Any ideas, holler. Thanks....
Jacob Punton's user avatar
0 votes
3 answers
3k views

Search - Check if post is a page on search page

I have a search page that when you enter a blank query, it shows posts and pages together. This isn't an issue, it's fine. However I'd like to remove some details like the date from the pages as it ...
user avatar
0 votes
1 answer
142 views

Posts are not showing up on next page.

I am using WordPress 'wp_page_numbers' plugin and the next pages are empty. I'm not sure what's going on with my code but it's suppose to start over again on the next page. Here is what I have............
Michael Stokes's user avatar
0 votes
2 answers
387 views

How do I make a variable available inside partials?

I've got a partial called within single.php that looks like this: <?php $userdata = get_userdata($post->post_author) ; ?> <div class="entry-meta"> <span class="byline ...
dave dave's user avatar
  • 175
1 vote
2 answers
2k views

Loop and Page template : my WP_query don't take args

I have a problem with a loop that I try to put into a custom Page template. I would like to display posts with conditions, but whatever I put in my WP_query parameters, it is not taking in ...
Marcus's user avatar
  • 11
0 votes
1 answer
2k views

Exclude page from loop results

I am having difficulties excluding a specific page from my main index loop in my child theme. I have the following function found in functions.php that modifies my index.php loop so that it displays ...
Sweepster's user avatar
  • 255
0 votes
0 answers
163 views

Retrieving category pages from subcategory returns empty sets

I've a category overview page. It shows its subcategories. These subcategories have subsubcategories which are pages too. I'd like to retrieve those (title, permalink and excerpt) but so far my ...
RubenGeert's user avatar
0 votes
1 answer
45 views

Getting the Most Recent Posts from Multiple Categories

I've got a page (page, not post) that near the bottom of the page I want to get the most recent 15 posts from a set of categories. I'm new to doing this and thought I was doing it correctly. The div (....
Keefer's user avatar
  • 316
0 votes
2 answers
1k views

Display specific page (that is child) content on parent page

I have problem displaying child page content on parent page (both static). I can display other page content but only if on same level. It dosent work in relation parent - child. <?php $...
Maciek Wrona's user avatar
1 vote
2 answers
41 views

How does the loop know which post to view?

I think I have understood most of how to create my own themes but this one thing: How can a loop in say page.php know which page to view when it loops through all the pages on my site? If I load one ...
KAS's user avatar
  • 13
0 votes
2 answers
1k views

Get post content from outside the loop with plugin shortcode usability

This is great for showing just the raw content... Get post content from outside the loop But i'd also like to apply shortcodes from various plugins to my content to affect the content. What would I ...
Pete's user avatar
  • 1,048
0 votes
1 answer
95 views

Loop through two different sets of custom fields

I created a Custom Field ('custom_name') to allow content editors to specify a 'custom_name' (different from the title of the page) to any post created: custom_name - (Field type --> 'text') For a ...
John's user avatar
  • 125
0 votes
2 answers
7k views

Trying to list out child pages with WP_Query

I'm trying to list out all the child pages of a custom page I've made. In my custom page, I'm doing this to list out the pages: <?php get_header(); ?> <?php $subpages = new WP_Query( ...
ptf's user avatar
  • 423
0 votes
1 answer
1k views

Issue in If else condition [closed]

I'm calling my all pages on one pages as a section. Here is my code: <?php $args = array( 'post_type' => 'page', 'orderby' => 'ASC', '...
Hussy571's user avatar
0 votes
1 answer
87 views

Calling Specific Pages with wp query Part II

I'm making one page website and I added a custom field on "Page" post type that asks "Use this page as a section:" Yes or No(with dropdown). I called all pages on template-onepage.php(custom template) ...
Hussy571's user avatar
1 vote
1 answer
2k views

page.php showing loop of posts and not page content

My front page displays the latest posts using index.php. My page.php contains the wp_header up top, the wp_footer below, and this in between: while (have_posts()) : the_post(); get_template_part(...
Sultenhest's user avatar
0 votes
1 answer
1k views

Price comparison table based on Custom Post Type?

I have created a review site where clients can rate their hosting providers based on various factors, however since the launch, many have asked if it would be possible to create a price comparison ...
Aidan Knight's user avatar
0 votes
1 answer
2k views

Structure and Display Content from Multiple Pages on Single Page

I am trying to display the content from multiple pages on a single page. However, for each page I need the title, excerpt, content and featured image. The display of each page's content has a ...
the Freelancer's user avatar
0 votes
1 answer
43 views

Making a specific page wordpress compatable that is not index

When I first created my website I overwrote the wordpress php and essentially made the website static. Now I want to make one specific page wordpress compatable (e.g. when i make posts from the ...
zgnohc's user avatar
  • 1
1 vote
0 answers
1k views

Get Page content to displayin Bootstrap Modal

Ok I'm a relative novice here, and after looking around I still haven't found the answer to my problem. I'm basically trying to link a Bootstrap Modal to some text in a footer (widget), the content of ...
Alexander Stanuga's user avatar
0 votes
0 answers
32 views

Default Template infinite loop of Title

Pages which have no specific template assigned output an infinite amount of h2 page titles, which looks like this: This is what my Themes index.php looks like: get_header(); ?> Hallo ...
Christoph Bühler's user avatar
-3 votes
2 answers
70 views

What function does the loop of displaying posts?

What is the function that does the echoing of posts like post title in h1 and then the post body and then the author name. I hope everyone understood what I'm trying to say else please ask in comments ...
Faiz Ahmed's user avatar
0 votes
1 answer
79 views

How to include custom post type posts on a page?

I need help adding a Portfolio page to one of my main Pages. I don't know what information is needed, so I'll just throw in some of the important stuff. Basically I have my main menu, (Welcome, ...
Jori's user avatar
  • 1
0 votes
1 answer
2k views

List all anchor links on a page

I was trying to make a navigation menu of all the anchor links on a page (similar to wikipedia) but couldn't find out how. I tried to find a plugin that could do it, but they only listed the anchors ...
asemahle's user avatar
  • 103
0 votes
1 answer
80 views

Have multiple loops on a page appear after/between page content

I created a function (in function.php) that allows me to put additional loops for different categories into pages: function custom_summary($atts) { extract(shortcode_atts(array( "...
Christian Macht's user avatar
0 votes
1 answer
109 views

Print the whole page?

I am trying to make a loop to loop all pages beneath each order. I want this because I want to make a one-pager with a page as an element of the one-pager. So that you can go into WP to edit a page ...
Maartje's user avatar
  • 547