Rachel Cherry
Forum Replies Created
-
Problems with permalinks can be tricky to solve because they can be caused by multiple factors. Have you tried the following suggestions?
My custom post type and/or CPT-onomy archive page is not working
If archive pages are enabled but are not working correctly, or are receiving a 404 error, it’s probably the result of a rewrite or permalink error. Here are a few suggestions to get things working:- Double check “Has Archive Page” Make sure the archive pages are enabled.
- Are pretty permalinks enabled? Archive pages will not work without pretty permalinks. Visit Settings->Permalinks and make sure anything but “Default” is selected.
- Changing rewrite rules: Whenever rewrite settings are changed, the rules need to be “flushed” to make sure everything is in working order. Flush your rewrite rules by visiting Settings->Permalinks and clicking “Save Changes”.
If none of those solved your problem, can you send me a screenshot of the “Advanced Options” in the CPT-onomies settings for your custom post type?
Hey… thanks for letting me know. I could be mistaken but I believe this is a problem with the All-In-One plugin.
They are using meta boxes on their settings page, which is fine, but they are using the ‘add_meta_boxes’ action hook to add their meta boxes, which is also fine, BUT this is a core WordPress hook that should pass 2 parameters: the page and the object ($post, $link, $comment, etc) being edited.
Since they are using it on a settings page, they don’t have an object to edit so they didn’t pass a second parameter. If they are going to use this hook, they should include a second parameter, even if it’s a blank one, so everyone else who uses the hook will not get errors.
Like I said, I could be mistaken and perhaps it is all my fault but I’m pretty sure this is an All-In-One issue.
Glad you figured it out!! Let me know if you have any more issues.
Ah! You are correct. I must have had ‘pad_counts’ on the brain from looking at the code.
Glad it’s working. I’ve fixed the code for the next version.
It’s an error on my part that will be fixed in the next version.
For now, just add ‘pad_counts’ => true to the arguments and it will include the count.
What’s your code look like?
Hmm… so wp_insert_post() doesn’t work but $cpt_onomy->wp_set_object_terms() does?
Is wp_insert_post() being called because you’re editing a post? Or because you’re calling wp_insert_post() on your own?
Forum: Plugins
In reply to: [Plugin: CPT-onomies]Listing custom posts within the LoopI can’t think of any better options at the moment. If something strikes, I’ll let you know.
I did the exact same thing a few weeks ago!
The answer? You have to add theme support for post thumbnails:
add_theme_support( 'post-thumbnails' );
You flatter me, sir. Glad you like it. =)
Forum: Plugins
In reply to: [Plugin: CPT-onomies]Customising the back end – wish listHmm… interesting. I’ll see what I can do.
Forum: Plugins
In reply to: [Plugin: CPT-onomies]Listing custom posts within the LoopIf you wanted to use the Loop, here’s a modified version of the code you supplied that loops through the queried posts to print out a list for each post type. The only thing that needs to be tweaked for this snippet is what to do if there are no posts for a particular post type but that wouldn’t be too difficult to fix if need be:
$directors_post_types = get_taxonomy( 'directors' )->object_type; $args = array( 'post_type' => $directors_post_types, 'tax_query' => array ( array ( 'taxonomy' => 'directors', 'field' => 'id', 'terms' => get_the_ID() ) )); // The Query $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) : $ptype = 0; do { ?><h3><?php echo get_post_type_object( $directors_post_types[ $ptype ] )->labels->name; ?></h3> <ul><?php while ( $the_query->have_posts() ) : $the_query->the_post(); if ( get_post_type( get_the_ID() ) == $directors_post_types[ $ptype ] ) : ?><li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li><?php endif; endwhile; $ptype++; ?></ul><?php } while ( $ptype < count( $directors_post_types ) ); endif;
Another option is what nprior suggested:
$directors_post_types = get_taxonomy( 'directors' )->object_type; $posts = get_posts( array( 'post_type' => $directors_post_types, 'include' => $cpt_onomy->get_objects_in_term( get_the_ID(), 'directors' ) )); // group by post type $all_posts = array(); foreach( $posts as $this_post ) { $all_posts[ $this_post->post_type ][] = $this_post; } // foreach post type lets you print something out of if no posts exist foreach( $directors_post_types as $post_type ) { ?><h3><?php echo get_post_type_object( $post_type )->labels->name; ?></h3><?php if ( isset( $all_posts[ $post_type ] ) ) { ?><ul><?php foreach( $all_posts[ $post_type ] as $this_post ) { ?><li><a href="<?php echo get_permalink( $this_post->ID ) ?>" rel="bookmark"><?php echo get_the_title( $this_post->ID ); ?></a></li><?php } ?></ul><?php } else { ?><p>There are no posts.</p><?php } }
Did either of these do the trick?
Hey! I just released 1.0.3 which includes Bulk and Quick Edit support.
When you get a chance to test it out, I’d love to know what you think!
Forum: Plugins
In reply to: [Plugin: CPT-onomies]Customising the back end – wish listHey! I just released 1.0.3. and, when you get a chance, would love your feedback on the sorting and filtering.
Version 1.0.3 is now available and should fix your issue, however 1.0.3 requires WordPress 3.1.
If you’re using WordPress earlier than 3.1, re-download CPT-onomies 1.0.2 to fix the screen issue.
Let me know if you need any more help!
Thanks!