Support » Theme: News Portal » Limit number of post displayed by widget “NP: Block posts”

  • Hi,

    can you tell me how I can limit the number of posts that is displayed by the widget “NP: Block posts”? Currently, if you look at my website, you find that the widget displays one post with a larger image and five posts with a smaller widget (see the one with the title “Branche”). I would like to change the widget so that there are just four posts with a smaller image instead of five.

    Thanks!

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author Mystery Themes

    (@mysterythemes)

    Hello @hardseltzerinsider

    Please add the following code in additional CSS box in customizer:

    .news_portal_block_posts .layout1 .np-secondary-block-wrap .np-single-post:last-child {
    	display: none;
    }

    Thanks 🙂

    Thread Starter hardseltzerinsider

    (@hardseltzerinsider)

    Thanks, it worked!

    One other question: I changed the code in the CSS box in the customizer so that the text of each post is moved a bit from the left side to the center.

    However, this change also occured in the mobile version of the website. I would prefer if the text is just moved to the center in the case of the desktop version. Can you change my code? I used the following code:

    .single-post .hentry {
        padding-left: 10%;
    }
    Theme Author Mystery Themes

    (@mysterythemes)

    Hello @hardseltzerinsider

    You can add the following code in additional CSS box in customizer:

    .single-post .hentry {
    	padding: 0;
    	text-align: center;
    }

    Thanks 🙂

    Thread Starter hardseltzerinsider

    (@hardseltzerinsider)

    Hi @mysterythemes, your code does not solve the problem. I want to change this code

    .single-post .hentry {
        padding-left: 10%;
    }

    in a way so that it just applies to the desktop but not to mobile devices. Is this possible?

    Theme Author Mystery Themes

    (@mysterythemes)

    Hello @hardseltzerinsider

    You can use the following code to make code affect in desktop version only:

    @media (min-width: 1300px) {
    .single-post .hentry {
        padding-left: 10%;
    }
    }

    Thanks 🙂

    Thread Starter hardseltzerinsider

    (@hardseltzerinsider)

    Ok, on my mobile phone, I do not see a change after inserting the above code into the CSS box in the customizer. The text is still moved to the center.

    One other question: Is it possible to limit the number of posts displayed by the widget “NP: Block Posts” to four in total (1 larger image on the left and 3 smaller images on the right)? Right now, I have five in total.

    Theme Author Mystery Themes

    (@mysterythemes)

    Hello @hardseltzerinsider

    You can use the following code in additional CSS box :

    @media (max-width: 1200px) {
    .single-post .hentry {
    	padding-left: 0;
    }
    }
    .news_portal_block_posts .layout1 .np-secondary-block-wrap .np-single-post:nth-last-child(2) {
    	display: none;
    }

    Thanks

    Thread Starter hardseltzerinsider

    (@hardseltzerinsider)

    Hi @mysterythemes,

    the code for the widget worked, thanks.

    However, the code for the the change of the layout of the mobile version did not work. Just one article correctly changed on my mobile phone (the one titled “Holy-Chef: Bei uns ist die Nachfrage im Juni explodiert”). All other articles remain the same.

    Theme Author Mystery Themes

    (@mysterythemes)

    Hello @hardseltzerinsider

    Maybe due to cache, you are not seeing changes. We can see that the above code was working fine on mobile devices as well. We recommend you to clear the cache of the browser and website.

    Thanks 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Limit number of post displayed by widget “NP: Block posts”’ is closed to new replies.