Community Forums › Forums › Archived Forums › General Discussion › Custom post types for movies
Tagged: custom post types
- This topic has 3 replies, 3 voices, and was last updated 9 years, 9 months ago by surefirewebserv.
-
AuthorPosts
-
January 14, 2015 at 3:07 am #137394paaljoachimMember
I copied the custom post types from Executive Pro into my functions file in my custom child theme and adjusted to fit with movie instead of portfolio:
//* Create Movie Type custom taxonomy add_action( 'init', 'custom_type_taxonomy' ); function custom_type_taxonomy() { register_taxonomy( 'movie-type', 'movie', array( 'labels' => array( 'name' => _x( 'Movie Category', 'taxonomy general name' ), 'add_new_item' => __( 'Add New Movie Category' ), 'new_item_name' => __( 'New Movie Type' ), ), 'exclude_from_search' => true, 'has_archive' => true, 'hierarchical' => true, 'rewrite' => array( 'slug' => 'movie-type', 'with_front' => false ), 'show_ui' => true, 'show_tagcloud' => false, ) ); } //* Create movie custom post type add_action( 'init', 'custom_movie_post_type' ); function custom_movie_post_type() { register_post_type( 'movie', array( 'labels' => array( 'name' => __( 'Movies' ), 'singular_name' => __( 'Movie' ), ), 'has_archive' => true, 'hierarchical' => true, 'menu_icon' => 'dashicons-video-alt', 'public' => true, 'rewrite' => array( 'slug' => 'movie', 'with_front' => false ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes', 'genesis-seo', 'genesis-cpt-archives-settings' ), 'taxonomies' => array( 'movie-type' ), ) ); }
I also renamed the three files that had the name portfolio in them into:
archive-movie.php, single-movie.php and taxonomy-movie-type.php
(I did not change any content inside of these files.)The part that is not working (as I know about right now) is clicking the "View the movie archive" text link inside Archive Settings. As it opens to a file not found.
I really need some tips/advice/help on a good way to add a custom post type called movie to my custom child theme. I am redoing Oslo Spiritual Film Clubs web site into WordPress and plan on using the movie post type in it. I am doing it the manual way instead of using a plugin to learn about how to use custom post types.
At the same time I plan on creating a tutorial out of it to add to my web site easywebdesigntutorials.com which in a sense will be part two for this post: http://easywebdesigntutorials.com/custom-post-types-used-in-genesis-child-themes/
I design, instruct, help people to understand WordPress through my tutorials as well as create web sites and hold classes where i teach WordPress and Adobe software. easywebdesigntutorials.com
January 14, 2015 at 3:41 am #137401CarloMemberHI there. Sometimes when registering post types and taxonomies, you need to do a hard refresh. More info here:
http://www.refreshyourcache.com/en/cache/
January 14, 2015 at 6:53 am #137427paaljoachimMemberI did some research and changing the rewrite slug one has to go to the Settings -> Permalinks and resave the Permalinks. Clicking the Archive Settings - View the movie archive text links will then work. If I change the rewrite slug again I have to go back and resave the Permalinks again.
Next up is customizing the CSS of the archive page and learning about how to use Custom Meta Boxes to customize the movie pages (posts). Since I plan on creating a standard for all the movie pages that have a poster image, synopsis, technical info, an embed of a trailer, a few images from the movie etc it will I believe be fitting to use meta boxes.
Since I got this thread going I'll use to to share what I learn along the way.
I design, instruct, help people to understand WordPress through my tutorials as well as create web sites and hold classes where i teach WordPress and Adobe software. easywebdesigntutorials.com
January 14, 2015 at 8:00 am #137439surefirewebservMemberI personally like to take the easy way out and use a plugin called Types and Views. Custom Post Type and Page Template all done in less than an hour =D
SureFireWebServices.com | Genesis Tuts and More
Genesis Theme Starter Kit | It’s Free -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.