hello developer
i used your plugin and it worked good but with wp 4.0 it stops to work.
i always see an empty archive message.
the cpt are generated bye an event manger plugin.
if i send you the website link could you help me?
thanks
https://www.ads-software.com/plugins/custom-post-type-archives/
]]>Everything works fine but i need to redirect it to /lang/ in a multilanguage site. How to fix it?
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Hi, i’ve declared a custom post type, and i’m using this plugin to show the list of all post related, but i’m getting the following problem:
https://www.example.com/{post-type}/2013/02/
works!
https://www.example.com/{post-type}/page/2/
works!
https://www.example.com/{post-type}/2013/02/page/2/
do not works! (the result shows all posts, type=’post’ too)
I’ve already made this fix (https://www.ads-software.com/support/topic/plugin-custom-post-type-archives-paging-problem-with-yearlymonthly-archives?replies=4#post-2655714) but i’m still getting this error.
Is there a fix?
Thanks
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Hi!
First of all, thanks for your necessary plugin. Sadly custom post types aren’t still developed enough in WordPress.
My website has a section of events, wich are a custom post type. I registered it with the following code:
register_post_type( 'agenda',
array(
'public' => true,
'hierarchical' => false,
'has_archive' => true,
'rewrite' => array( 'slug' => 'evento' )
)
);
After the Custom Post Type Archives plugin instalation I configured the options of ‘agenda’ archives setting de “Rewrite Slug” field as “calendari”.
In the templates for single and archive of this post type I call the function for archives list like this:
wp_get_post_type_archives( 'agenda' );
but it doesn’t return anything. I read many times your instructions to get this, but when you say “The first argument should be the rewrite slug for your custom post type” I don’t know if I have to write “agenda” wich is how I registered the post type, “evento” wich is my rewrite slug, or “calendari” wich is the rewrite slug of the archive.
Anyway, any of this 3 options return anything.
Do you know what can be wrong?
Thanks!
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Hi there !
Just to tell you that at least 1 stripslashes is missing in your lovely script :
If I add a new Custom Post Type with a quote in the name, a slash will appear in the admin menu.
To fix this, I added a stripslashes() in the function cpt_create_custom_post_types() when you declare $cpt_label.
Before:
$cpt_label = ( !$cpt_post_type["label"] ) ? esc_html($cpt_post_type["name"]) : esc_html($cpt_post_type["label"]);
After:
$cpt_label = stripslashes( ( !$cpt_post_type["label"] ) ? esc_html($cpt_post_type["name"]) : esc_html($cpt_post_type["label"]) );
Regards,
Quentin.
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>I’m getting 404 errors on every page when using this plugin with WP 3.4. Let me know if I can provide any more information to help.
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Hi guys,
I’ve setup the plugin and most of it seems to be working except when I try to use the wp_get_post_type_archives() function. (Which is the main reason I’m using this plugin).
It correctly lists out the months in the sidebar, with the correct post counts for each but when you click to view that month it takes you to WordPress’s posts archive for that month instead of the custom post type’s.
In other words the links take you to:
https://www.site.com/2012/05/
Instead of:
https://www.site.com/archive/newsletters/2012/05/
Any ideas?
Note: I’m using the Custom Post Type UI plugin along with this one. I currently have ‘Has Archive’ set to false in that plugin.
Thanks.
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>This is both a question and information to save someone the pain I went through.
If you have the WordPress – Settings – Permalinks – “Custom Structure” set to something hard coded like: /news/%postname%/ then the archive links for your custom post types do not work!
What happens is the hard coded URL gets appending to whatever custom post archive rewrite URL you’ve set. For example if you have an Event post type, set to rewrite to /events/ the URL for the archives is generated as /events/news/2012/02. Notice the “news” being added to the URL.
You can fix this problem by simply having an entirely dynamic URL in your Permalink setting, ex: /%postname%/.
However, if you have your regular post type / blog setup as a sub-folder you then can’t have that folder display in the URL. This is not the end of the world, but it’s less than ideal. It means when the user is in say https://www.site.com/news/ but when they click on archives they get a root URL of just https://www.site.com/2012/02/. But then for your custom post type archives they get nice subfolder URLs. We should be able to have it for post standard and CPTs.
Is there any way to fix this?? Thank you so much in advance.
]]>When activated a Fatal Error was recorded…and thus the plugin did not actually activate. All I was really looking for was a way to use “wp_get_archives()” with custom posts since archives are now possible with Custom Post Types. It’s hard to believe wp_get_archives is not yet setup to handle CPTs.
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Great plugin!! Hadn’t noticed any issues at all until recently…
I have the archives for a custom post type set for the yearly type. The first page of the archive works fine (/post-type-slug/2011/), but when I click the “Older Posts” button I get a 404 error (/post-type-slug/2011/page/2/). I have this problem with all my custom post type archives, but not with the default WordPress blog archives.
Any suggestions?
I am using version 1.5.1 of the Plugin.
Thank you
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Just wanted to thank you for this plugin. Works flawlessly. I was really astounded that the date archives for custom post types don’t work even in 3.2.1
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>How can I remove the trailing slash?
Thanks
]]>Fatal error: Cannot redeclare is_post_type_archive() (previously declared in /home/roughm5/public_html/wp-includes/query.php:163) in /home/roughm5/public_html/wp-content/plugins/custom-post-type-archives/post-type-archives.php on line 384
That’s on https://roughmountainstudios.com after upgrading to 3.1
]]>Fatal error: Cannot redeclare is_post_type_archive() in /home/*/*/example.com/blog/wp-content/plugins/custom-post-type-archives/post-type-archives.php on line 361
]]>This plugin doesn’t use the contextual_help filter correctly, and as a result when it is active, the contextual help on all core admin pages does not appear.
Will there be a fix for this soon?
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>function is_post_type_archive() is a function in wordpress 3.1 wp-includes/query.php, this needs to be renamed, you missed this one when you were doing prefix’s for your other functions ??
– Phil
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Hi!
This is my address:
https://www.mysite.com/foto/category/motorbikes
Where “foto” is a post type and “motorbikes” is category. In these kind of areas (post_type + category) I want to include different sidebar than in category area, so that’s what I do:
if(is_category()) {
if(is_custom_post_type_archive('foto')) {
echo '<h2>Sidebar foto</h2>';
include('sidebars/sidebar_foto.php');
} else {
echo '<h2>Sidebar category</h2>';
include('sidebars/sidebar_category.php');
}
}
but is_custom_post_type_archive(‘foto’) doesn’t work and sidebars/sidebar_category.php is included.
Am I missing something?
Thank you
Matteo
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Hi There. I switched to using your code on the current site I’m building … thank you for your work … but wanted to let you know that the conditional for is_post_type_archive is failing on me sporadically.
I added in a function to flush the rewrite rules on activate and deactivate of the plugin, and have to do this in order to gain functionality of the conditional again … otherwise it just continues to fail and my sidebars that are meant to show up in the archive don’t get pulled in.
I have no idea what is causing this, but, thought you might be interested in taking a look to troubleshoot? If so, just let me know and I’ll give you a login to the site to take a look.
Figured I would try here before going ahead and just hard coding a different sidebar for those ??
Hi,
I’ve been trying to implement the wp_get_post_type_archives() into my template but with no success. The documentation only provided this:
I’ve made a new function ‘wp_get_post_type_archives’ that works basically the same way as the ‘wp_get_archives’ function from WordPress. Actually it uses that function to get all the data and formatting. I only had to make this wrapper function to fix the links that link to these archives, because WordPress sadly didn’t have enough hooks in that function. This function has two parameters:
* $post_type – string with post type rewrite slug to whom do you want to get archives from. You can also supply ‘all’ as a value – that will return links to archives for ALL the custom post types. The only thing is – you have to make the homepage to include all the post types if you want this to work (to support ‘all’ value, rest will work perfectly).
* $args – the same arguments as you would pass to ‘wp_get_archives’ function.
I’ve tried everything, but it seems that it only shows the default post type, not the custom post types post.
I’ve tried:
<?php wp_get_post_type_archives('post_type=blogs&type=monthly&show_post_count=true'); ?>
and
<?php wp_get_post_type_archives('post_type=blogs','type=monthly&show_post_count=true'); ?>'
and also
<?php $post_type = array(‘post_type’ => ‘blogs’);
$args = array(‘type’ => ‘monthly’, ‘limit’ => 12, ‘show_post_count’ => true);
wp_get_post_type_archives(‘post_type=blogs&type=monthly&show_post_count=true’); ?>`
I’m not sure what I’m doing wrong as I am new with PHP.
A documentation with example codes would be great.
Thanks in advance.
https://www.ads-software.com/extend/plugins/custom-post-type-archives/
]]>Could you please update the plugin or explain how the plugin could be extended so that if your using the built in WordPress Menu Management features that all your post types show up within a new metabox or somewhere? I feel this is very important.
Thanks!
]]>