Tagged: x
-
AuthorPosts
-
January 12, 2017 at 11:30 am #1327459
I am using Icon
I am trying to make a CPT for a “Project” and then have a “Projects Page” where all the individual projects are listed and displayed.
So far I have done the following:
Added the following code to functions.php in my child theme:
function projects_init() { $labels = array( 'name' => __( 'Projects' ), 'singular_name' => __( 'Project' ), 'all_items' => __('All Projects'), 'add_new' => _x('Add New Project', 'Projects'), 'add_new_item' => __('Add New Project'), 'edit_item' => __('Edit Project'), 'new_item' => __('New Project'), 'view_item' => __('View Project'), 'search_items' => __('Search in Projects'), 'not_found' => __('No Projects found'), 'not_found_in_trash' => __('No Projects found in trash'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'has_archive' => true, 'rewrite' => array('slug' => 'projects'), 'query_var' => true, 'menu_icon' => 'dashicons-hammer', 'supports' => array( 'title', 'editor', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'thumbnail', 'author', 'page-attributes',) ); register_post_type( 'projects', $args ); } add_action( 'init', 'projects_init' );
Next, I made a couple ‘test projects’ through the dashboard of my site. The projects were created successfully, and the interface to make them on the dashboard worked correctly.
Next, I made a “Projects” page through the dashboard. This is the page I would like to display a listing of all ‘projects’
Next, I made sure there was a “Projects” tab in appearance->menus.
Next, Everything starts going off the rails. I have tried doing the things listed in these posts:
https://community.theme.co/forums/topic/custom-post-type-list-page-template/ (answer was vague, tried but it didnt work)
https://community.theme.co/forums/topic/custom-template-for-custom-taxonomy-archive/ (did exactly what ebrammer said, but no projects show up on my Projects page)
https://www.elegantthemes.com/blog/tips-tricks/creating-custom-post-types-in-wordpress (followed this tutorial up till Step 4. They say to use
page.php
. They also point out that you need to add this:/** * Template Name: Projects **/
In order for WP to recognize it as a template….is this true?
I’m assuming since I want a page that displays a listing of all projects, that I need to make an
archive-projects.php
, which is based offindex.php
(from what I gather).I also assume that since in Xtheme parent there is always code in both the functions.php AND the view for Icon, that however I get this to work….I’ll need to put code in the x-child for BOTH the functions.php and the view folder for Icon.
I’ve tried lots of configurations with making
single-projects.php
,archive-projects.php
,page-projects.php
….nothing has worked so far.If anyone could please give me a detailed walk-through for how to get a listitng of my CPTs to display on a single page of my website, I would greatly appreciate it!!!!
Thanks for any help in advance!
January 12, 2017 at 4:13 pm #1327829Hi There,
Thanks for writing in.
In this case, first, Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
January 12, 2017 at 5:19 pm #1327894This reply has been marked as private.January 12, 2017 at 5:36 pm #1327901This reply has been marked as private.January 12, 2017 at 9:05 pm #1328204This reply has been marked as private.January 12, 2017 at 10:32 pm #1328268This reply has been marked as private.January 12, 2017 at 11:17 pm #1328308Hi there,
We’re not working on it. And we usually request site backup before doing anything. We don’t switch theme and disable plugins without permission from the owner.
Since it seems someone is working on it, then I’m not going to check it yet. Please restore it to how it’s used to be.
Thanks!
-
AuthorPosts