Featured Posts Background Color

  • Hi Taras,

    I just noticed that posts that were set to appear in “featured posts” and that end up appearing in the “all posts section” have a different background color than the regular posts.

    If you check on my website, on the English version, you will notice that the background color is supposed to be white, but I have a cream color.

    https://cld.wthms.co/Sd3rTo

    Do you have a CSS to make featured posts background color white?

    Thank you!

    Savannah

    The blog I need help with is: (visible only to logged in users)

  • Hello Savannah,

    The reason why these posts (https://snipboard.io/AGU5Nj.jpg) have a different background color is because they are displayed as a sticky posts (https://en.support.wordpress.com/post-and-page-visibility/#sticky-posts-posts-only).

    Sticky posts comes with its own background color because they have a little bit different functionality than regular posts. A different background color is used to distinguish them from regular posts.

    If you want to change a background color of your sticky posts, please use this custom CSS:

    
    .archive-grid .sticky {
      background-color: #ffffff;
    }
    

    Thank you,
    Taras

  • Hi Taras,

    Thanks for your answer.

    I was also wondering, is there a way to limit the number of featured posts to 2 without me having to constantly remove the tag and the sticky option?

    Thank you!

    Savannah

  • Savannah,

    If you want to show only primary section in the Featured Content section, please use this custom CSS hide other posts in the section:

    
    #featured-content .secondary-section {
      display: none;
    }
    

    Please let me know if you have any additional questions.

    Thanks,
    Taras

  • Hi Taras,

    I’m already using this code. I found it in another topic on the forum :)

    I was just wondering if there was a way to limit the number of featured post to two because this code is only hiding the secondary section, so when I add a new featured post, one gets hidden -which is logical because of the code- and I have to manually remove the tag and uncheck the ‘sticky post’ box in order for it to appear in the ‘all posts’ section.

    But if it’s not, possible, that’s fine lol.

    Thank you!

  • Savannah,

    By default, the theme does not have an option to limit the number of featured posts.

    Since you have a Business plan, it will be possible for you to change this number via a code snippet.

    Also, I am going to provide you a step by step guid on how to change it once a new update will be pushed to Business plan sites.

    Thank you,
    Taras

  • Hi Taras!

    Thanks so much. You’re so helpful.

    You deserve an award.

    Thanks again.

    Savannah

  • Hello Savannah,

    Not a problem :)

    It seems like a new update has been pushed to pushed to Business plan sites, so it’s possible to change a number of posts shown in the Featured Content section.

    First, please install the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/).

    By the way, it’s a good practice to check the Incompatible Plugins list (https://en.support.wordpress.com/incompatible-plugins/) before installing the plugin at WordPress.com. The Code Snippets plugin is not in the list, so we are good to go.

    Once the plugin is installed and activated on your site, you should see the Snippets link in the main menu section in your Dashboard:

    1) Click on Add New to create a new code snippet.

    2) Add a title for your code snippet. For example, Set the Featured Content posts number.

    3) In the Code section, add the following code:

    
    function aquene_change_featured_content_max_posts() {
    	return 2;
    }
    add_filter( 'aquene_jetpack_featured_content_max_posts', 'aquene_change_featured_content_max_posts' );
    

    4) Click “Save Changes” to save your code snippet.

    The number of the Featured Content posts will be updated once you’ve posted a new post.

    Hope this helps. Please let me know if you have any additional questions.

    Thank you,
    Taras

  • Hi Taras,

    Thanks so much for getting back to me.

    I tried to add the code that you provided me with but it says that there’s a syntax error in it.

    I tried to ignore this message and checked what it does when that code is activated, but the number of featured posts is still at 5.

    What can we do?

    ***

    I believe that I’ll always have stuff to ask lol.

    When on an author’s page, I’d like the picture of my authors to show on the mobile version of my website, remove the “Author:” so it’s only their name & description that shows, and center the whole thing.

    Is this possible for you?

    Thanks in advance!

    Have a nice weekend, Taras.

    Savannah

  • Hello Savannah,

    “I tried to add the code that you provided me with but it says that there’s a syntax error in it.”
    – Could you please share a screenshot (https://snipboard.io/) of this snippet in your Dashboard?

    “When on an author’s page, I’d like the picture of my authors to show on the mobile version of my website…”
    – Please add this custom CSS to your site:

    
    .archive.author .page-title span:first-child {
    	display: none;
    }
    
    @media only screen and (max-width: 500px) {
    	.archive.author .page-header .avatar {
    		display: block;
    		order: -1;
    		margin: 0 auto 30px;
    	} 
    
    	.page-header {
    		flex-wrap: wrap;
        	        text-align: center
    	}
    }
    

    Thank you,
    Taras

  • Hi Taras!

    I got WordPress’ live chat assistance to help me with this because it took my website down because of the syntax error.

    Everything is working fine now and I believe they used what you said but probably in a proper way than I did lol.

    Thanks for the author css!

    Have a nice day :)

    Savannah

  • You are very welcome Savannah! :)

    Thanks, you too.

    All the best,
    Taras

  • The topic ‘Featured Posts Background Color’ is closed to new replies.