Site logo

Archived topic

change content of archive custom post type

25 replies · Started by David on April 8, 2019

Viewing posts 1–15 of 26

Hello

I've set up a new custom post type called team.

I've then created a archive-team.php page and put that in the child theme - I'm then looking at changing the layout of the archive team page so have copied over the content page and renamed it content-team.php and put in to child theme folder.

When I make any changes to the content-team.php page though, nothing changes!

http://185.20.51.60/~skyworldco/team/

Please help.

Thanks
Dave

Great, thanks - how can I get the team custom posts to show in descending order?

Thanks
Dave

You could try something like this:

add_action( 'pre_get_posts', function( $query ) {
    if ( $query->is_main_query() && ! is_admin() ) {
        if ( $query->is_post_type_archive( 'team' ) ) {
            $query->set( 'order', 'DESC' ); 
        }       
    }
} );

Thanks Tom

That's the single.php file :)

So how would I go about making this appear in 2 columns? so the featured image is to the left?

I can't see the code for this in single.php

The featured image is hooked into the template, so you would have to disable the featured image and then add it manually to the template.

What kind of layout are you going for? Any examples of what you want vs what you have?

Trying to create this...

https://ibb.co/HGXRNVz

Haven't thought about how to do the pop up yet, just trying to get the layout of the team member correct.

Thanks
Dave

And what do you have so far? Will you end up adding it as a popup?

You could try this CSS:

.single-team .featured-image {
    float: left;
    max-width: 50%;
    margin-right: 2em;
}

.single-team .entry-content {
    overflow: hidden;
}

How are you adding those images? the_post_thumbnail()?

This archived topic is closed to new replies.