Community Forums › Forums › Archived Forums › Design Tips and Tricks › "Recent Posts" not showing custom post types
Tagged: Custom Post Type, outreach, widget
- This topic has 24 replies, 3 voices, and was last updated 10 years, 4 months ago by styzer.
-
AuthorPosts
-
July 1, 2014 at 12:04 am #112313styzerParticipant
Hi all, I'm trying to show recent posts on my home page (Outreach Pro) in the home-bottom widget section. But only the "posts" are showing, which are called "articles" in custom post designation. I tried many plugins as well but no joy.
I have two options:
1- find a solution to display a selection of posts, like a menu type but I choose the posts to show.
2- Use the space under the home-bottom to show a few blog entries with excerpts.
I need to display dynamic content on the home page, and this is what I believe would work best - show posts that my client can select herself, and display it with a feature image and excerpt.
The site is here: http://thresholdpublications.com/ortzion3/ and we're a few hours away from launching it.
Thanks for any help!
regards,
Andre
http://thresholdpublications.com/ortzion3/July 1, 2014 at 4:46 am #112362Brad DaltonParticipantJuly 1, 2014 at 10:47 am #112462DTHkellyMemberHere's a Genesis-based, Featured CPT option:
July 1, 2014 at 11:14 am #112464DTHkellyMemberFor Custom Post Types, Ultimate Posts Widget does not filter by CPT taxonomy. Only post categories.
July 1, 2014 at 11:42 am #112467styzerParticipantHi Brad, Kellylise,
I installed the plugin Kellylise suggested on a cloned location:
http://creativeforge.org/ortzion-july/
Still nothing showing. Let me show you the code for the newsletters custom post type, see if you notice anything wrong that would keep it from showing?
// Register Custom Post Type function newsletter_post_type() { $labels = array( 'name' => _x( 'Newsletter Types', 'Post Type General Name', 'newsletters' ), 'singular_name' => _x( 'Newsletter', 'Post Type Singular Name', 'newsletter' ), 'menu_name' => __( 'Newsletters', 'newsletters' ), 'parent_item_colon' => __( 'Parent Item:', 'newsletters' ), 'all_items' => __( 'All Items', 'newsletters' ), 'view_item' => __( 'View Item', 'newsletters' ), 'add_new_item' => __( 'Add New Item', 'newsletters' ), 'add_new' => __( 'Add New', 'newsletters' ), 'edit_item' => __( 'Edit Item', 'newsletters' ), 'update_item' => __( 'Update Item', 'newsletters' ), 'search_items' => __( 'Search Item', 'newsletters' ), 'not_found' => __( 'Not found', 'newsletters' ), 'not_found_in_trash' => __( 'Not found in Trash', 'newsletters' ), ); $args = array( 'label' => __( 'newsletter_type', 'newsletters' ), 'description' => __( 'Newsletter Type Description', 'newsletters' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ), 'taxonomies' => array( 'category', 'post_tag' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'menu_icon' => '', 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', ); register_post_type( 'newsletter_type', $args ); } // Hook into the 'init' action add_action( 'init', 'newsletter_post_type', 0 );
Beyond that, my only thought would be that somehow my functions.php got something deleted that should usually show those custom posts in a widget. They show on the site, just not in a "featured" aspect. I thought maybe even using a hook to create a section underneath that home-bottom section, where I could have featured posts with excerpt,
Thanks for all the help!
Regards,
Andre
July 1, 2014 at 12:29 pm #112480DTHkellyMemberSorry - my skills are too limited to evaluate your code (or mine for that matter!).
http://coolestguidesontheplanet.com/create-custom-post-types-in-genesis-child-theme-in-wordpress/Sometimes in Genesis you have to enable support for a specific custom post type and a plugin.
http://ahjira.com/enable-genesis-simple-sidebars-plugin-for-custom-post-types/Example of enabling Product CPT support from Genesis Simple Sidebars:
add_post_type_support( 'product', 'genesis-simple-sidebars' );
July 1, 2014 at 12:36 pm #112483DTHkellyMemberYou could also try http://wordpress.org/plugins/custom-content-shortcode/
July 1, 2014 at 10:18 pm #112558Brad DaltonParticipantJuly 1, 2014 at 10:23 pm #112559styzerParticipantHi Brad,
It's from the functions.php file, where the custom-type posts were entered in.
July 1, 2014 at 10:37 pm #112560Brad DaltonParticipantJuly 1, 2014 at 11:26 pm #112565styzerParticipantYes, it is from the Outreach Pro theme, which I had modified to create custom types by a third-party.
July 1, 2014 at 11:41 pm #112568Brad DaltonParticipantThe code for custom post types is not included in the Outreach Pro theme so its third party code which could be the reason its not working.
I suggest you take the code from the Executive Pro theme and modify it for your CPT.
July 1, 2014 at 11:48 pm #112570styzerParticipantSo are you saying that there is no way to have custom posts with Outreach Pro natively? I knew something wasn't jiving... Gosh all this work... Thanks Brad, I'll look into it...
Regards,
Andre
July 2, 2014 at 12:22 am #112575Brad DaltonParticipantI'm saying to use the code from the Executive Pro theme rather than code from an external source.
July 2, 2014 at 11:06 am #112650styzerParticipantHi Brad,
Well I've done so - I copy/paste the "create custom type" code from Executive Pro and now none of my content will show. All the links were changed following this. Menu became duplicated and I can't make sense of it. So the whole things is messed up. I'm going to reinstall.
Could you be more specific as to what code you see would work for this and how to avoid messing up all the links and menus by doing this? Where and how should I make the changes? As you may have guessed, this is beyond my head, so if you have step by step instructions that would help greatly!
Regards,
Andre
July 2, 2014 at 10:20 pm #112770Brad DaltonParticipantI have written about this many times already but it may be a problem with your existing code modifications.
July 2, 2014 at 10:46 pm #112775styzerParticipantCan you direct me to your writings?
July 2, 2014 at 11:37 pm #112781July 2, 2014 at 11:50 pm #112782styzerParticipantOK, I found it.
here is the code I'm using, and after resaving my permalinks all my former "Newsletters" posts have disappeared. Is there a code to grab all the CPT that were created before today instead of disappearing?
//* Create Custom Post Type add_action( 'init', 'add_custom_post_type' ); function add_custom_post_type() { register_post_type( 'newsletters', array( 'labels' => array( 'name' => __( 'Newsletters', 'ortzion' ), 'singular_name' => __( 'Member', 'ortzion' ), ), 'has_archive' => true, 'hierarchical' => true, 'menu_icon' => 'dashicons-admin-users', 'public' => true, 'rewrite' => array( 'slug' => 'newsletters', 'with_front' => false ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes' ), 'taxonomies' => array( 'category' ), 'menu_position' => 2, )); }
Thanks!
July 3, 2014 at 12:42 am #112788Brad DaltonParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.