Home › Forums › Pro Support › post layout
- This topic has 22 replies, 3 voices, and was last updated 2 years, 2 months ago by
elvin.
-
AuthorPosts
-
March 2, 2021 at 3:46 am #27558
John
Participanterr the other css didn’t work either
March 2, 2021 at 5:26 pm #27572elvin
ModeratorAny chance you could link us to the page in question? To check why it isn’t working.
You can send us the link on through contact page if you wish to keep it private.
https://wpshowposts.com/contact/March 2, 2021 at 6:10 pm #27579John
Participantemail sent
March 2, 2021 at 6:54 pm #27581elvin
ModeratorThanks!
I’ve observed the site and the margin-top is actually applying but it’s only significantly noticable if the value is higher than 18px because the header actually has margin equal to this value.
Try this approach
section#wpsp-193 .wp-show-posts-entry-header { margin: 0 0 30px; }
Let us know how it goes.
March 9, 2021 at 1:09 pm #27835John
ParticipantThanks elvin!
is there a way to make the list on the right go like this when on mobile
image on left then headline on right and except underneath
but only on mobile?
March 9, 2021 at 8:00 pm #27853elvin
ModeratorThis is pretty tricky to do.
Do you want this applied on all WPSP lists?
If so, try this:
Use this PHP snippet to wrap the contents.
add_action('wpsp_before_header',function(){ echo '<div class="content-wrapper">'; }); add_action('wpsp_after_content',function(){ echo '</div>'; });
And use this CSS to make the image and the wrapped content to display in a row:
@media(max-width:767px){ .wp-show-posts-inner { display: flex; } }
If you want the exact same layout including the comments link position and the terms position, you may have to edit the plugin or completely disable them and hook your own layout on
wpsp_after_content
.March 11, 2021 at 6:13 am #27911John
Participanti just want it applied to the list on the right
March 11, 2021 at 6:13 pm #27933elvin
ModeratorIf you want it to be applied to the list on the right-hand side you’ll have to add specific id selectors to the CSS and add the WPSP ID to the hook.
Example: If there are multiple WPSP list on your sidebar.
add_action( 'wpsp_before_header', function( $settings ) { // Lists we're targeting, replace with actual list IDs. $lists = array( '123', '456', '789' ); if ( in_array( $settings['list_id'], $lists ) { echo '<div class="content-wrapper">'; } } ); add_action('wpsp_after_content',function( $settings ){ // Lists we're targeting, replace with actual list IDs. $lists = array( '123', '456', '789' ); if ( in_array( $settings['list_id'], $lists ) { echo '</div>'; } });
And the CSS:
@media(max-width:767px){ section#wpsp-123 .wp-show-posts-inner, section#wpsp-456 .wp-show-posts-inner, section#wpsp-789 .wp-show-posts-inner { display: flex; } }
Note: You don’t need to make arrays if you only want to target one specific WPSP list.
Example:
add_action( 'wpsp_before_header', function( $settings ) { if ( 123 = $settings['list_id'] ) { echo '<div class="content-wrapper">'; } } ); add_action('wpsp_after_content',function( $settings ){ if ( 123 = $settings['list_id'] ) { echo '</div>'; } });
And CSS:
@media(max-width:767px){ section#wpsp-123 .wp-show-posts-inner { display: flex; } }
Where
123
should be the WPSP list on your right side of the site. -
AuthorPosts
- You must be logged in to reply to this topic.