Site logo

Archived topic

Custom Post Type Templyte code

8 replies · Started by Juergen on July 6, 2017

Viewing posts 1–9 of 9

Hi,

I created a Custom Post Type and would like to show as an overview excerpts within tiles. Each post should be showing in one tile and as a standard there should be two columns with tiles. Everything responsive and on smartphones one column of tiles only.

Each tile should show the post title, the header image, some custom post fields and the content.

Is there some good documentation available how to get this solved smart and easy?

Thanks for your feedback!
Juergen

Check out: WP Show Posts another great plugin by Tom.
And here's a link on how to add the custom fields.

WP Show Posts is definitely one solution.

You could use the Columns feature in the Blog add-on to achieve the tiles, then use the available hooks to hook in your custom fields.

Maybe the question is a little bit silly, but I have no clue how to apply the blog add-on. On posts there is an option to select the template but at the GeneratePress design this function is not available. Is there another way to use the blog template?

Hi,

that works perfect - Thanks.

How can I make the sorting of the posts random and not in a special order?

Regards,
Juergen

You could try adding some PHP like this:

function tu_rand_posts( $query ) {
    if ( $query->is_main_query() ) {
        $query->set( 'orderby', 'rand' );
    }
}
add_action( 'pre_get_posts', 'tu_rand_posts' );

Hi,

is there a template I can use to modify the output of WP_SHOW_POST? Does something like "archive-customposttypename" work?

Thanks,
Juergen

WP Show Posts doesn't have a specific page template - it outputs your post using a function.

This archived topic is closed to new replies.