you don’t want the link to the actual post then use the field link again:
<?php
$args = array(
'numberposts' => '5',
'orderby' => 'post_date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'weekly_mktg_report',
'post_status' => 'publish'
);
$recent_posts = wp_get_recent_posts( $args );
echo '<ul>'; //i was not sure if you had the list start anywhere else
foreach( $recent_posts as $recent ){
echo '<li><a href="'.get_field('report').'" target="_blank"> </li> ';
}
echo '</ul>'; //list end
wp_reset_query(); //have you considered wp_reset_postdata() and using wp_query
?>
I put some comments in the code too as there may be some errors. Not sure if this is the full code.
Related Posts:
- Custom post types, taxonomies, and permalinks
- Permalinks: custom post type -> custom taxonomy -> post
- Mixing custom post type and taxonomy rewrite structures?
- Resolve a custom post type name vs. page permalink conflict (same slug)
- How to rewrite URI of custom post type?
- How to change permalink structure for custom post type and it’s taxonomies?
- Change permalinks for posts but not for custom post types
- How do I append multiple taxonomies to the URL?
- Custom post types – Use post_id in permalink structure
- Custom post type permalink: only use %post_id% and remove %postname%
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- Rewrite custom post type rss feed links
- 404 on child page when parent page slug is identical to custom post type
- rewrite get parameter with custom post type
- Having a custom post slug that clashes with an existing directory
- post_type_link filter causes 404 on the CPT page it’s used on
- Remove unwanted part of permalink custom structure from CPT url?
- Custom permalinks – post type – hierarchical taxonomy’s
- Changing a custom post type “has_archive” after registered
- dynamically update permalink and title with the values of custom fileds
- Change permalink structure for custom post type
- Custom post types and permalinks : What a mess !
- Custom Post Type slug same as page name causing a conflict
- Custom Post Type “Event” with custom permalink structure
- Permalinks for custom post-types within custom taxonomies not found
- After updating a page, all pages on the site used the index.php template
- Parent & Child Taxonomy slugs in custom post permalink
- Custom Post Types and independent Categories – complex Taxonomy
- Easy way to change custom post type name for permalinks?
- Update permalinks when new category added to custom post type taxonomy
- Use menus with anchors
- Permalink structure by Post Meta value
- custom post type parsed as attachment
- 404 Issue w/ Custom Post Type – using Meta for Permalink rewrite
- WordPress Custom Post Type Permalinks dynamic term slugs
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- custom-taxonomy/post_name instead of the default post_type/post_name
- How to add rewrite rule to custom post type with parent in url with cpt ui?
- Create a custom php page and load it at a specific slug
- Permalinks /country/city/cpt/postname/
- Custom Permalink to remove category word , keeping posts permalink with date?
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- Seamless permalinks between Custom Taxonomy and Custom Posts
- Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
- How to include term custom meta into the custom taxonomy term permalink structure
- Path to custom post type
- How to change permalink to include custom post type
- Make custom post types and pages place nice, re: rewrite
- set permalink for CPT
- Remove custom permalink structure from custom post type without modifying register_post_type() directly
- Permalink problems with custom post type and custom taxonomy
- Route subpage to Custom Post Type
- Custom Post Type “MUST NOT” be able to search via URL
- Custom Post Type Advanced Slug
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- Under What Conditions Can I name my CPT the same as my CPT Page?
- Custom post type category permalinks and archive pages
- Safe to throw 404 error in request filter?
- One Custom Post Type two different Templates
- Adding /blog in front of single posts (only)
- How to remove /blog/ prefix for custom post types in permalinks?
- 404 error rewrite permalinks
- On saving Post My permalink is updated and category is removed automatically which cause the 404
- Searching in multiple category + URL hierarchy in real estate WordPress site
- Custom post ID & display information related to this ID
- Edit the default ‘post’ custom post type arguments
- add all blog posts to folder
- Category permalinks don’t work even after flushing
- Changing permalink of default Post with custom post
- CPT and rewrite rules
- Custom Taxonomy Archive generates 404
- Enabling hierarchical in a Custom Post Type gives error 404
- Custom post type single with custom URL structure
- Standard Page Child of CPT Not Found (404)
- News post with multiple permalinks? When opened from different page
- How to create a permalink structure with custom taxonomies and custom post types
- Permalinks change when edit published post on custom post type
- Custom permalink rewrite rules – how do I fix this?
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- How to retrieve custom post type permalink in another cpt?
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Post Custom & Taxonomy 404 error
- Same permalink structure for all post types?
- the_permalink() leads back to homepage
- Custom post type with parent page? Possible?
- Hierarchical taxonomy in permalink structure
- Can’t make permalink of CPT work
- Issue with permalinks for custom post type
- Cross post type parent page added parent page to permalink but give 404
- Category / Custom Post Type permalink issue
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- “regular” pages not found after changing permalink
- Custom Post Type and Taxonomy pagination permalink
- permalink structure for single-{post-type}.php in wordpress
- Linking from a list of custom post type items to a single – get_post_permalink not working correctly
- Custom post type permalink structure
- How do I use CPT and permalinks with a mobile theme?
- Can I have a specific template for products even if they are standard posts and not CPT?
- Custom Post Type, 404 error
- How to get permalink of post based on post name?