There might be other causes to the issue in question, but one issue I noticed in your code is that because you are looping through a custom WP_Query instance, i.e. $loop, then you need to use $loop->the_post() instead of just the_post():
while ( $loop->have_posts() ) {
$loop->the_post();
the_title();
}
And you could see that I simply called the_title() and not doing echo get_the_title(), so you should also do the same.
Related Posts:
- Display articles with a different template in the home page | Solved |
- Query multiple custom post types in single loop
- Inject post (from specific category) between posts in Loop
- Alter query on edit.php
- Specific Loop For 2 Within Each
- spliting posts into two columns
- How to get to a specific position in wp_query?
- How can I add extra word in permalink when someone click download button?
- Increase offset while looping
- remove post that has no content
- How to add div blocks after certain set of post
- How to avoid duplicates when creating recent network posts
- How to overwrite orderby with add_query_var
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Issue with custom loop in Archive page
- Only show first image in foreach loop
- Do not duplicate posts with multiple categories in multiple loops
- Limit tags shown in post
- How to pick “full/thumbnail” images in the loop?
- Echo array value
- Wp Query : Order by distance lat,lon
- Advanced Query posts
- Build A Custom SQL Query for WordPress Search
- My Custom Post Type AJAX Query is Returning no posts – why?
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- Is there anyway I can call the year once?
- How do if all posts has this category ID then do this
- Let user select the number of posts shown per page jquery error
- Get current_post in reverse order with pagination
- Pagination in WP Queries
- Add div after every 4 posts then every 2 posts for a responsive loop
- Insert div after every three posts in home.php [duplicate]
- Get posts associated with media attachment
- Automatically create a loop for post ID
- Problems With Query and/or Template Part and/or PHP
- Excerpt all post content Content Same Size without word cutting off
- How to create a loop that will display one post and stop?
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Count the number of matching post names in foreach loop
- Build a content and excerpt grid loop with paging and options for # of posts
- Delete post revisions on post publish
- How to loop over custom fields in a page template?
- How to sort results from a custom database table
- WP Insert Post function – Insert Post Thumbnail
- WordPress – query 5 posts with a specific post in top
- How to speed up a wordpress function with multiple loops?
- $wpdb->flush(); breaks the loop
- Which hook/action will help me solve my problem?
- Get children post mime type using parent post_ID wp_post
- How to setup a query to output posts by groups of five?
- Get post id within comments loop
- Syntax error when I try to insert my loop into an unordered list? [closed]
- WP Insert Post and then go to post
- Custom Pagination is Broken
- Get latest post from all categories except one
- Parse error: syntax error, unexpected end of file
- How can I remove the first two words and shorten get_the_title()
- Load Posts on Click via Ajax into a DIV
- get_the_ID() in the footer returns wrong value
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Shortcode to pull posts
- WordPress upload file size error even after raising php limits
- Echoing a CSS class based on category of post in a list
- Undefined variable: row?
- Php code error in wordpress if else statements [closed]
- pagination broken – clicking next displays “page not found”
- WordPress is removing query variables like page, p from the URL of a custom static page
- remove specificly the last tag in all posts
- Add posts to custom table in database instead of wp_posts
- How to show categories and date on posts
- How do I get pagination for get_posts() in WordPress or do I have to rewrite the whole code?
- Check if current post in loop is last on current page
- Query on a repeater date (acf)
- Trying to show the category of a post in the post display
- Split post or page content in two or more columns
- Check the database for a postmeta field
- Send POST request to Flask app from functions.php file
- How can i limit the number of posts to the most recent 6 in my query?
- Send Notification after post published was working but stopped after the last WP update
- adding or removing endforeach; throws error!
- Adding PHP to an if else loop
- wordpress query returning unexpected results
- How to insert text into post based on category – via single.php file
- Generate random access token to a post page
- Filter loop by ‘price’ with meta_query
- Problems with the WordPress loop [closed]
- Only display notification on single post
- How can I display a query in a page?
- WordPress while loop with aphabetic counting like one, two, three
- Add post class in custom loop (WP_QUERY)
- Passed variable gets undefined variable error on insert on next page
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- I want my wordpress loop to only display posts of the standard format
- Why does WP_Query show only the same post even with different categories and endwhile?
- why is this content-template not showing any of my blog-entries?
- Trying to display ads on only a third of posts in a loop. Keep getting Error 500?
- How to call the_author_meta and make it work?
- Query posts by custom fields (object post)
- Show post like this image in my newssite [closed]
- How to allow searching a custom meta key in admin list table?