This will display the title of the page when a static page is set to show posts.
E.g.
I show posts on my homepage…
It’ll do nothing.
If I, say, show posts on page titled News…
It’ll show News in H1.
This is used so that the title of the page is shown, whenever posts are shown on a page, but nothing when blog posts are shown on the front page (home page).
We do it because if it’s on home page… it will show the title of the first post, making it appear twice (once at the top in H1 and again when posts are looped through).
Related Posts:
- Second Loop Showing Only One Post on Single Post Page
- Get markup for post without loading into the template
- Jquery Slider for profile template
- Why do themes rely on “The Loop”?
- Is including the loop necessary for page.php? [duplicate]
- What is best way passing variables to theme templates and using them different places like widgets?
- include(locate_template) messing up the loop
- Page template not displaying
- Loop through pages with specific template
- How to get_template_part using AJAX?
- wp alchemy multiple image uploader output images to template
- code suddenly appearing from my tempate second loop
- Get search.php results in header.php?
- WordPress Loop inside Loop?
- Template structure
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Order archive results by post id in custom taxonomy template
- Default ‘post’ post type archive slug?
- How do I make a variable available inside partials?
- Update status of all posts in a category
- 404 Template customization | Want 10 recent Post on the 404.php error page apart from the error Notice
- How do I put my frontpage featured image in a page template for home.php?
- Call wp-blog-header.php header without performing a wp_query
- How to render the single post template with the post name?
- excerpt not showing up
- How to add a byline to all the pages?
- new custom theme – posts displaying on top of one another
- How do i create a list-posts-page?
- How to sort a loop after most viewed
- How to loop specific Category menu from archive page?
- How do I set the Stewart Search Template to return only published posts in the result
- Is it possible to set archive.php instead of index.php to display blog?
- Using is_page_template inside loop
- Trying to get property ‘post_content’ of non-object
- is it bad to copy the loop for a template?
- Is “the loop” a template tag?
- Deeply Nested Menu Loop with Twig using Timber [closed]
- WordPress with woocommerce custom query
- Infinite Loop after Genesis Theme Upgrade
- Alternative layout the loop
- Cant pull in featured Image
- Template included with plugin doesn’t return all posts for custom taxonomy
- Creating a archive for taxonomy terms, not the term results
- Default Template infinite loop of Title
- Secondary loop cuts off at 10 posts?
- Need a conditional to test if title of parent page matches title of child page
- get all page templates
- Load featured article once in a loop
- wordpress showing all posts instead of date range
- How to implement template file and the loop
- Same posts within a paginated page
- Meaning of “if ( is_home() && ! is_front_page() )” snippet?
- How can I create an entirely new, separate display of posts?
- Can I use non-wordpress themes in WordPress?
- How to declare a variable in a loop and make it available in the template file
- Get a Post Loop based on Logged in User information into a Shortcode
- the_date() and the_time() functions display actual date an time instead of published date and time
- How to read taxonomy in loop?
- Set depth of pages to fetch
- ACF: display custom filed of CPT into the loop
- Trying to get all links in my posts
- Display articles with a different template in the home page | Solved |
- Loop keeps showing the same post even when I click on a different one
- Adding $args to wp_schedule_event() causes hook to add infinitely to WP Cron
- $post is undefined in wordpress loop [ajax]
- Query users and count totals based on meta values
- How to add pagination in Terms
- Mobile Menu and Mobile Sidebar missing
- WordPress keeps switching back to empty template
- wp_get_attachment_url not fetching URL?
- Duplicated tag in loop
- get the value for ALT is we check to see if an actual ALT value is set, if not we use the caption and if no caption is set we use the title
- Check if current post in loop is last on current page
- Related post not showing table of content
- Insert content above an embedded video inside Wordress’ php the_content
- Creating a User-Adjustable chart in WordPress
- Undefined index: page in loop load ajax content
- Database query and get_user_meta return incorrect data
- php loop error for count posts in category
- Removing a widget via theme editor
- display post pdf attachments in side bar with link text
- How to display fields from the loop in two separate divs
- Loop only shows first two posts
- Why is my archive page looping through all but one post?
- Loop two different category WP_Query
- Adding a second loop breaks everything
- Use ACF Category Image for all Taxonomy Archive Views
- Solved – Inserting content inside the WordPress loop
- WordPress posts in the loop not stacking side by side
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- WordPress posts loop not displaying all posts on blog
- Display all the terms within a custom taxonomy
- get_page_by_title not working inside fucntions.php
- A code that I could not fully grasp related to foreach & count_user_posts()
- Local variable name in setup_postdata()
- Need to while loop and display contents in the subfield of a group field given by ACF
- How to use single.php output in function.php
- How to separate post titles with a comma in the loop?
- Custom Query with Sticky Posts
- Add Search and Filter functionality to custom loop