Home Page Featured Image Slider

  • Author
    Posts
  • #149053

    Hi!

    I wanted to know if there is anyway to replace the featured image of the homepage with an image slider? Right now I have a static home page :) and I don’t want to show clickable posts, just images with texts.

    The blog I need help with is profiles-peru.com.

    #149059

    tarasdashkevych
    Theme Author

    Hello,

    You can use the Feature Content section as a slider (it will be located at the top of the Front Page) and I can provide you a custom CSS to disable links in this section.

    The Featured Content section on the Front Page template will display a slideshow of posts. These posts are selected by assigning them a specific tag of your choosing. For more information, please see “Featured Content” @https://wordpress.com/theme/venture/setup

    Could you please post a link to your site with an active Featured Content section, so I can provide a custom CSS for you?

    Thank you,
    Taras

    #149214

    Hi Taras,

    The link to the site is here but i dont know of you can see it because we actually have a maintenance mode activated: https://profiles-peru.com/

    There are 3 posts right now that are in the featured section and I want them to be not clickable and also; is there a way that these posts don’t appear on the blog section of the site? Thanks in advance for the support.

    #149216

    tarasdashkevych
    Theme Author

    You are right. I cannot see the site.

    Please try this custom CSS:

    
    .featured-content .hentry a {
      pointer-events: none;
      cursor: default;
    }
    

    It should disable links inside the posts/pages located in the Featured Content section.

    “is there a way that these posts don’t appear on the blog section of the site?”
    – You can try 3rd party plugins to hide specific post in your blog page or any other archive view:

    (1): https://wordpress.org/plugins/wp-hide-post/
    (2): https://wordpress.org/plugins/whp-hide-posts/

    By the way, it’s a good practice to check the Incompatible Plugins list (https://en.support.wordpress.com/incompatible-plugins/) before installing any plugins at WordPress.com.

    Hope this helps.

    Thanks,
    Taras

    #149226

    Hi Taras,

    I used the custom CSS for the Featured section and it works well! Thanks for that.

    I tried using one of the plugins you suggested me there to hide posts, but there is one little problem: I only want to hide the posts from the Blog section of the page but not on the Home page so it can still be shown on the Featured Slider.

    When I use the plugin it only gives me the following options:

    Hide on frontpage

    Hide on categories

    Hide on search

    Hide on tags page

    Hide on authors page

    I used “Hide on Frontpage” but then the post dissapears from the slider and the blog section.

    Is there anyway to do that with a plugin or CSS? Please let me know.

    Thanks,

    Daniel

    #149236

    tarasdashkevych
    Theme Author

    Daniel,

    Unfortunately, it’s not possible to accomplish with CSS only.

    I’m going to investigate this further for you and to try to find a better way to hide the featured posts on the blog page. I’ll be back in touch when I have an update.

    If it’s something urgent then you can try use pages instead of posts. In this case, these pages will not be shown in the blog page.

    Let me know if you have any other questions.

    Thank you,
    Taras

    #149374

    Hi Taras,

    It’s not that urgent, right now I’m using blog posts but let me know when you have an update on the matter.

    Thanks,

    Daniel

    #149401

    tarasdashkevych
    Theme Author

    Daniel,

    I’ll let you know in this post when it’s ready.

    Thank you,
    Taras

    #149417

    tarasdashkevych
    Theme Author

    Hello Daniel,

    After some investigation, I’ve found out that the Featured Content section is designed to hide the featured posts only on the page where the Featured Content section is located. So, we can avoid duplicates on the same page.

    Also, I’ve tried to find a plugin that can hide the posts on the blog page but it was not successful. I am thinking to write such plugin and submit it to WordPress.org plugin directory once I’ll have a free time.

    For now, I’ve written a code snippet for you to hide these posts.

    First, please install the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). You can use this plugin for adding any custom code snippets to your site.

    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, Hide Featured Posts.

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

    
    function venture_hide_my_featured_posts( $query ) {
    	if ( $query->is_home() && $query->is_main_query() ) {
    		$posts_to_hide = array( 2355, 1741 );
    		$post__not_in = $query->get( 'post__not_in' );
    
    		if ( ! empty( $post__not_in ) ) {
    			$posts_to_hide = array_merge( (array) $post__not_in, $posts_to_hide );
    			$posts_to_hide = array_unique( $posts_to_hide );
    		}
    
    		$query->set('post__not_in', $posts_to_hide );
    	}
    
    	return $query;
    }
    add_filter( 'pre_get_posts', 'venture_hide_my_featured_posts' );
    

    In the code above, you’ll find the following line: $posts_to_hide = array( 2355, 1741 );. Each number represents the post ID. Please replace it with your featured posts IDs. Here is a quick tutorial on how to find the ID: https://en.support.wordpress.com/pages/#how-to-find-the-page-id

    4) Below the code textarea, please select “Only run on site front-end”.

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

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

    Thank you,
    Taras

    #149536

    Hi Taras,

    I used the Code Snippets plugin as you told me and it worked perfectly, thank you very much!

    I’ll let you know if I have any doubts in the future.

    Thanks,
    Daniel

    #149591

    tarasdashkevych
    Theme Author

    You are very welcome Daniel!

The topic ‘Home Page Featured Image Slider’ is closed to new replies.