Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with cptda_get_archives function #5

Open
Nick-Fiasco opened this issue Jun 29, 2018 · 1 comment
Open

Issues with cptda_get_archives function #5

Nick-Fiasco opened this issue Jun 29, 2018 · 1 comment

Comments

@Nick-Fiasco
Copy link

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.

@Nick-Fiasco
Copy link
Author

Hi @keesiemeijer any thoughts on this?

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.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant