If I understand your question, the issue is that anything within the while
loop will get repeated for each post. If you want to wrap all posts in a single set of <ol></ol>
tags, those must go outside that while
statement.
if ( $the_query->have_posts() ) :
// open the <ol> outside the loop
echo '<ol class="col-neigh-title neighborhood">';
// anything inside here is repeated for each post
while ( $the_query->have_posts() ) :
$the_query->the_post();
?>
<li><a href="https://wordpress.stackexchange.com/questions/114741/<?php the_field("url_neighborhood' ); ?>"><?php the_field( 'neighborhood_name' ); ?></a></li>
<?php
endwhile;
// close the <ol> outside the loop
echo '</ol>';
endif;
Related Posts:
- How to export custom post type with ACF to individual file with automation?
- Custom Post Type and Structure Question
- Adding specific custom fields (images) to post excerpt
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- save_post affect creation and deletion
- Advanced Custom Fields – Add Field to Specific Page [closed]
- Collection of fields in a single post
- importing third party json feed as custom post type [closed]
- Admin Post Update Redirection to Posts Screen
- modify all posts of a category to “no comments allowed”
- WP Rest API Querying Custom Posts by ACF fields
- How to not allow custom roles to edit published custom post types?
- Assign Page Template Within A Custom Post Type
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Single Page WordPress CSS and JS links
- [Plugin: Posts 2 Posts] Changing display order of connections
- Disable dragging of metaboxes in custom post types?
- How to set custom post type as post title to avoid ‘Auto Draft’
- Error after deleting Custom Post Type with a function (no trash used)
- Query current and future events, ordered by begin date
- Change message given when deleting post from custom post type
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- How to delete all posts from a custom post type?
- Structure for projects and clients
- Why is my custom loop not filtering correctly nor paginating?
- Custom post types with custom directories
- Saving repeated option values in a custom query
- Query Custom Post Types by date (custom field) range
- How to customize admin posts based on the user who is logged in
- Custom Post Type | Fatal Error on register_post_type()
- Remove duplicated values from a loop
- apply filters only to specific post listing without check the url parameters
- Dynamically add / duplicate custom meta in custom post types
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- “add_post_type_support” with Custom Post Type & ACF
- How can I create a custom meta box to add an mp4 video to a page?
- Custom Post type and Custom Field WP_Query
- Custom post type menu missing after 3.0b2 -> 3.1.2 upgrade
- Group posts by custom post type
- Plugin: register custom post types, child ready and performance best practices
- Define new user capability for custom post types?
- How to add a post slug to a url?
- ACF Field on CPT Slug
- Custom Post Type + ACF and performance [closed]
- Meta Query Not Returning Output Despite Having Matching Values
- How to handle paged param in post and custom-post-type?
- Shortcode to display Staff post type based on Location post type and Specialty post type
- The loop seems stuck to a single (now deleted) post
- How to add attributes to taxonomies that may be different from post to post?
- Displaying custom field according to date
- How does order=asc effect a wp_query (its acting pretty weird in a loop)
- How to sort posts in a custom post type by title in ascending order by default?
- Sort a custom post with ACF: Date Picker & Display Featured!
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Custome fields not displayed
- Create short URL with auto 301 redirect
- Why is wp api returning old acf values?
- get custom post type value in header.php [closed]
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- WordPress Count posts within a custom post type
- Custom post types, disable fields
- Custom Post Types and Removing Slugs – should we do it?
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- Custom Content Type with No Page View
- Custom post type tags not showing in search
- How to list posts by term (custom taxonomy)
- Excerpt length: get first paragraph
- Custom Post Type Implementation
- Related “custom post type” using “custom taxonomy”
- How do I disable the built-in editor and automatically configure the properties of new pages?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- count & sum the value of custom field of the author post in dynamic posts
- Orderby custom fields is not working
- Display a Custom Post Type with Advanced Custom Fields on Homepage
- Filter result of Custom Post Type using meta_query with ACF
- Same custom post type with different ACF
- How to limit the number of custom posts certain users can publish in WordPress using php script?
- Custom sorting in post columns by ACF Pro Select Field
- Custom page for creating/editing custom post type
- Subpages URLs for Custom Post Type
- What is WordPress Way to Add Content Blocks to Post and Reference them as Many to One Relationship?
- How to show link to product in custom fields?
- Displaying posts inside table having issues
- Building Link List for Custom Tax
- Looping through image object using ACF and CPT UI [SOLVED]
- WordPress page not showing up – replaced with last 10 posts?
- Best way to have one product in both rental and sale parent category
- How do I display specific custom posts, and how do I edit a post’s singular page?
- creating a custom post template
- Showing custom post user wise with different color in wordpress
- Cant edit custom post type in WordPress dashboard
- Filter Content on all Post Types
- Select Menu for Custom post Type does not save
- Inserting two categories
- How to delete unnecessary custom post types in the UI
- WordPress Loop trouble with ACF [closed]
- Advise on Custom Taxonomies and Structure
- Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?
- Delete old thumbnail when updating new
- Display ACF object field data using Elementor Custom Query