posttypes view on wordpress site

0

Friends I'm studying posttypes is running in the test environment the CRUD. But I do not know how to appear on the site ex: If I created a posttype portfolio or products for example, how do I make it visible to people to see, they are hidden in the admin, only in the admin they appear.

I used the following examples link link

How do I resolve this? Thank you in advance.

    
asked by anonymous 13.06.2016 / 01:51

1 answer

1

There are a few ways - Wordpress follows a pattern for viewing posts. An important point is the page hierarchy used by Wordpress, see here .

But let's go to practical examples - I'll use post_type cars as an example. - A simple way to test whether types of posts are available is to access the URL of your site by passing the post_type parameter. Example: localhost / site ? Post_type = cars , where cars is your post_type. Or, if the permalink settings are different from the default: localhost / site / cars .

If you do not have a specific template for your post_type, Wordpress will use archive.php , if you do not find it, you will use index.php . If you want to create an archive for your post_type just create a new file, in your theme, by following the archive_ [post_type] .php pattern, eg: archive-carros.php and in this file you can customize your layout to present information as you wish.

    
22.06.2016 / 15:28