- This topic has 25 replies, 2 voices, and was last updated 4 years, 12 months ago by Tom.
-
AuthorPosts
-
April 8, 2019 at 2:26 am #862611David
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
DaveApril 8, 2019 at 8:42 am #863032TomLead DeveloperLead DeveloperHi there,
In your
archive-team.php
file, replace this line: https://github.com/tomusborne/generatepress/blob/2.2.2/archive.php#L42With this:
get_template_part( 'content', 'team' );
Let me know if that helps or not ๐
April 8, 2019 at 8:46 am #863039DavidGreat, thanks – how can I get the team custom posts to show in descending order?
Thanks
DaveApril 8, 2019 at 3:58 pm #863358TomLead DeveloperLead DeveloperYou 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' ); } } } );
April 8, 2019 at 11:32 pm #863549DavidThanks Tom
April 9, 2019 at 5:54 am #863826DavidHi Tom
What file would I need to copy across to edit this page…
http://185.20.51.60/~skyworldco/team/chris-beer/I’ve sorted the archive page http://185.20.51.60/~skyworldco/team/chris-beer/
Thanks
DaveApril 9, 2019 at 8:46 am #864176TomLead DeveloperLead DeveloperThat’s the
single.php
file ๐April 9, 2019 at 9:25 am #864234DavidSo 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
April 9, 2019 at 3:22 pm #864470TomLead DeveloperLead DeveloperThe 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?
April 9, 2019 at 11:22 pm #864641DavidTrying to create this…
Haven’t thought about how to do the pop up yet, just trying to get the layout of the team member correct.
Thanks
DaveApril 10, 2019 at 10:01 am #865277TomLead DeveloperLead DeveloperAnd what do you have so far? Will you end up adding it as a popup?
April 10, 2019 at 10:21 am #865302DavidI have this so far…
http://185.20.51.60/~skyworldco/team/chris-beer/
Yes the aim is to get it to open in a pop up once I’ve got the layout sorted
Thanks
DaveApril 10, 2019 at 4:20 pm #865498TomLead DeveloperLead DeveloperYou could try this CSS:
.single-team .featured-image { float: left; max-width: 50%; margin-right: 2em; } .single-team .entry-content { overflow: hidden; }
April 16, 2019 at 7:08 am #870586DavidHi Tom
How do I add this class… class=”modal-link iframe” to the href tag on the images of the archive for my team page…
http://185.20.51.60/~skyworldco/team/
Thanks
DaveApril 16, 2019 at 1:54 pm #870949TomLead DeveloperLead DeveloperHow are you adding those images?
the_post_thumbnail()
? -
AuthorPosts
- You must be logged in to reply to this topic.