• Resolved ricdam

    (@ricdam)


    Hi there,

    I’m currently using oceanwp, and together with the “Popular Posts” gadget, my website also has “Most Recent” posts gadget and “Categories” (see website).

    Both “Most Recent” posts “Categories” gadgets have a line at the top and bottom of each post, which looks good because it separates each post and also gives a bit of space between each other.

    Is it possible to add these lines separating each post to the “Popular Posts” gadget?

    Thanks,

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @ricdam,

    Of course! Try adding these styles to your theme’s stylesheet:

    .wpp-list li {
        padding: 6px 0;
        border-bottom: 1px solid #e9e9e9;
    }
    
    .wpp-list li:first-child {
        border-top: 1px solid #e9e9e9;
    }

    When you’re done, do a “hard-refresh” on your browser (ctrl+F5 if on Windows, cmd+F5 if on MacOS) so it picks up this change.

    Thread Starter ricdam

    (@ricdam)

    Hi @hcabrera,

    I got the error below when adding your code to Theme functions (functions.php):
    “Your PHP code changes were rolled back due to an error on line 947 of file wp-content/themes/oceanwp/functions.php. Please fix and try saving again.
    syntax error, unexpected ‘.'”

    Line 947 is when your code starts.
    Any idea how to fix it?

    Thank you very much.

    Thread Starter ricdam

    (@ricdam)

    Also just noticed the plugin is listing posts but also listing pages.

    Are you able to advise how to list only popular posts, and exclude pages?

    Thanks @hcabrera

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @ricdam,

    I got the error below when adding your code to Theme functions (functions.php):
    “Your PHP code changes were rolled back due to an error on line 947 of file wp-content/themes/oceanwp/functions.php. Please fix and try saving again.
    syntax error, unexpected ‘.'”

    Line 947 is when your code starts.
    Any idea how to fix it?

    You got it wrong. The CSS code I posted above goes into your theme’s stylesheet, not into functions.php.

    Also just noticed the plugin is listing posts but also listing pages.

    Are you able to advise how to list only popular posts, and exclude pages?

    Yep! Go to Widgets > WordPress Popular Posts and under Post Type(s) set the field to post and click on Save to apply changes.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Marking as resolved due to inactivity.

    Hello, I just added the code to my site but it doesn’t separate the posts. I updated in the theme CSS. And would you consider adding this to the next update? It’s simple but yet important visually. I would delete this now and hopefully you can add more options to customize the front look.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @adrianczw,

    That CSS code was specific to OP’s theme. If you want some help with your site, please create a new topic and share your site’s URL.

    Also, the reason why WPP doesn’t include “options” to customize the front look is precisely this:

    I just added the code to my site but it doesn’t separate the posts.

    I can add “options” so people can choose from them but these won’t necessarily fit/work on their themes as these include their own set of CSS rules that might break things.

    Anyways, let’s continue the conversation on another topic.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Line separating each post?’ is closed to new replies.