- This topic has 7 replies, 2 voices, and was last updated 6 years, 5 months ago by
David.
-
AuthorPosts
-
October 22, 2019 at 7:09 am #1041241
Mahesh
Hello,
I am using the below code to show related posts under my content.
The problem is I can see the related post on the desktop but when I view it on my smartphone, there is no related post section.
You can check one of my links in the URL section.
What is the solution for this problem and if possible, is there any chance to reduce the grey section around the related post?Here is the code I am using:
<h2>Related Posts</h2>
<?php
if ( is_single() ) {
$cats = get_the_category();
$cat = $cats[0];
} else {
$cat = get_category( get_query_var( ‘cat’ ) );
}$cat_slug = $cat->slug;
$list = get_page_by_title( ‘related’, ‘OBJECT’, ‘wp_show_posts’ );
wpsp_display( $list->ID, ‘tax_term=”‘ . $cat_slug . ‘”‘ );
?>October 22, 2019 at 7:27 am #1041255David
StaffCustomer SupportHi there,
can you link me to a post where i can see the Related Posts section – i checked a couple but couldn’t see it.
October 22, 2019 at 7:42 am #1041274Mahesh
I have provided the link in the URL section.
You can visit that link via desktop & smartphone to see the difference.
Ensure to look at the related post section just below the content before the comment section.October 22, 2019 at 8:02 am #1041467David
StaffCustomer SupportI checked that link and cannot see the Related Posts section or any markup in the code.
Maybe a server caching issueOctober 22, 2019 at 8:29 am #1041495Mahesh
Ok, its a problem from my side.
Actually I set the login users as “logged in users” in the element section. So that is why only I can see the related post on the desktop and not on the mobile.
Anyways, could you please tell me how can I reduce the extra size of the grey section from the sides of related posts.
Or
Increase the related post thumbnail size so that the gap is filled.
You can check the post URL.October 22, 2019 at 9:06 am #1041541David
StaffCustomer SupportJust edit the padding property in this CSS:
.wpsp-related-posts { background-color: #f2f3f4; padding: 64px; /* reduce padding here */ -webkit-box-sizing: border-box; box-sizing: border-box; }October 22, 2019 at 11:47 am #1041667Mahesh
Thank You. Problem solved.
October 22, 2019 at 12:20 pm #1041696David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.