[Support request] A few questions – styling categories, removing links from comments

Home Forums Support [Support request] A few questions – styling categories, removing links from comments

Home Forums Support A few questions – styling categories, removing links from comments

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1014076
    Mark

    Hi,

    I’ve been building a site for a few days solid now and am very nearly finished, there’s just a few of things I need to clean up if possible, but am stumped after many hours of trying:

    1. What part of the theme code creates the ‘category description’? I normally add ‘and !is_paged()’ to to the code, so the category description only appears on page one of the paginated series. I can’t seem to find it.
    2. In the comment section, the date the user posted a comment is linked to their comment. How can I ‘unlink’ the date please? (Leave the date, but it links nowhere.) It’s not good SEO to have so many unnecessary links on heavily commented pages.
    3. On category pages, where you have a blogroll of up to, say, 10 posts…on every single one, the authors name is hyperlinked to their author page. How can I unlink their name please? (again, it’s just bad for SEO to have so many unnecessary links.)
    4. On my sites, at the end of every post, I am using the WP Show posts Pro plugin to show related posts. It’s injecting a pipe character at the end of the date: Why is this, and how can I remove it please? A couple of examples: https://cl.ly/51ed931284a3 , https://cl.ly/43306fed10d7 – but you can see it on any post.
    5. On the category pages on my site where you have the blogroll / list of posts (below any intro text I have added), the individual posts listed in a grid have a weird space to their left that shouldn’t be there, like a margin all the way down the left side, where the images touch the edge of the screen on the right. On firefox browser made small enough for mobile, or on mobile (chrome on samsung galaxy S8 and S10) you can see it, though you cannot on chrome desktop. Why is this spacing there please? I have removed all custom CSS and it still persists, so I’m stumped. Can we remove it and ‘center’ the blogroll posts?
    6. On category pages, how can I target margins / padding on the blogroll section only? What IDs or classes will allow me to put margins to the side of the blog post list only, without adjusting spacing at the side of the intro text? I’ve tried for a good couple of hours…but failed πŸ™
    7. Thanks in advance for any help and pointers you can give!

    #1014261
    David
    Staff
    Customer Support

    Hi there,

    Lets deal with the first 4 to begin with:

    1. You can use the filter Tom provides here to remove the description:

    https://generatepress.com/forums/topic/category-description-is-showing-twice-in-2-3/#post-918745

    2. Comments link – you would need to use a child theme copy of the includes/structure/comments.php and edit this line:

    https://github.com/tomusborne/generatepress/blob/e3baba60b8bc53ba52950b953c40eea1c164dfb8/inc/structure/comments.php#L44

    3. This snippet:
    https://gist.github.com/generatepress/67fb28af5c8be3103290

    4. Thats peculiar – not experienced that, are there any custom functions at play? If not you can use css to remove it – class is: wp-show-posts-separator

    #1014292
    Mark

    Hi David,

    Thanks for your help! I just logged into the forum and thought I would scroll through to find my posts and say you’re a crazily busy man! Makes my head hurt just thinking about it, haha.

    Anyway…

    1. Worked perfectly, thank you.

    2. When you say ‘edit this line’ – what edit would i make please?

    3. Worked perfectly, thank you.

    4. To display WP Show posts, I’m hooked into ‘after_content’ with the following code to display the posts:

    <div class="wpsp-related-posts  grid-container">
    	<h2>You May Also Like:</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 . '"' );
    ?>
    </div>
    

    I use these settings to show the meta: https://cl.ly/4739a56dfa8a

    And when I do, I get that pipe character at the end of the meta as seen here: https://cl.ly/70b3f0d4acc0

    Odd one.

    How would knowing the CSS class help to remove it? Surely I can only show or hide the whole thing, whereas I’d like the meta shown, it just shouldn’t have that pipe character at the end.

    Thanks,
    Mark.

    #1014303
    David
    Staff
    Customer Support

    2. You would replace that line with:

    <span class="comment-time"> and replace the closing </a> with </span>

    4. This CSS will hide just the separator:

    .wp-show-posts-separator {
        display: none;
    }
    #1014318
    Mark

    Hi David,

    2: I copied the comments.php file, and added it to my child theme in folders I created to mimic the parent theme structure like so:

    generatepress_child/inc/structure/comments.php

    I then edited line 44 to be what you suggested, and changed the closing tag (line 53) to a closing </span> tag…but it’s had no effect?

    4. That CSS worked perfectly, thank you πŸ™‚

    #1014669
    David
    Staff
    Customer Support

    Can you move your comments.php to the root of the child theme ie. generatepress_child-child/comments.php

    #1015416
    Mark

    The whole site in the front end goes a bit weird when I do that: All boxed, CSS looks broken, message displays at the bottom of the page like this: https://cl.ly/4a51cdc9f6c3

    #1015555
    David
    Staff
    Customer Support

    Place it back in the inc/structure folder and then remove these lines:

    /**
     * Comment structure.
     *
     * @package GeneratePress
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    }
    #1015579
    Mark

    Hi David,

    No effect seen, date is still a link.

    #1015733
    David
    Staff
    Customer Support

    Can you share me a link to the site?

    #1031874
    Mark

    Hi David,

    Sorry for the silence, I took a holiday…probably needed it after all the site rebuilding, haha.

    Anyway, back to it. Yes, I can share a link but would prefer not to publicly? Is there a way to share it privately?

    Thanks,
    Mark.

    #1032212
    Tom
    Lead Developer
    Lead Developer

    Hi Mark,

    You can edit your original post in this topic and add the URL to the private URL field πŸ™‚

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