[Support request] Custom Post Type Templyte code

Home Forums Support [Support request] Custom Post Type Templyte code

Home Forums Support Custom Post Type Templyte code

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #345222
    Juergen

    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

    #345341
    David
    Staff
    Customer Support

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

    #345362
    Tom
    Lead Developer
    Lead Developer

    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.

    #346340
    Juergen

    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?

    #346454
    Tom
    Lead Developer
    Lead Developer
    #346569
    Juergen

    Hi,

    that works perfect – Thanks.

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

    Regards,
    Juergen

    #346744
    Tom
    Lead Developer
    Lead Developer

    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' );
    #366677
    Juergen

    Hi,

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

    Thanks,
    Juergen

    #366756
    Tom
    Lead Developer
    Lead Developer

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

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.