You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just started using your plugin on recommendation of another developer.
I'm trying to use your function for getting the archive year links for a custom post type.
I'm getting an issue where the slug of my custom post type 'news' isn't displaying properly.
Still trying to find a solution that works here and grabs the url correctly without the %news_slug% in there but the correct, actual slug for the news archives.
Hi,
Just started using your plugin on recommendation of another developer.
I'm trying to use your function for getting the archive year links for a custom post type.
I'm getting an issue where the slug of my custom post type 'news' isn't displaying properly.
Like this;
http://localhost:8888/hca/%news_slug%/2018
Do you know what the issue may be?
Here is the code I have been using;
$theyearsargs = array( 'type' => 'yearly', 'format' => 'html', 'before' => '', 'after' => '', 'show_post_count' => false, 'echo' => 1, 'order' => 'DESC', 'post_type' => 'news', ); cptda_get_archives( $theyearsargs );
But also tried using the other function;
cptda_get_year_link( $year, $post_type = 'news' )
Both equal the same results.
I have the slugs setup within my custom post type code here;
`$args = array(
"label" => __( "News", "hca" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"has_archive" => "news",
"show_in_menu" => true,
"show_in_nav_menus" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => array( "slug" => "news", "with_front" => true ),
"query_var" => true,
"menu_position" => 5,
"supports" => array( "title", "editor", "thumbnail" ),
"taxonomies" => array( "news_category" ),
);
register_post_type( "news", $args );
add_post_type_support( 'news', array( 'date-archives' ) );`
Any help would be greatly appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: