Suppress flexslider on posts page for Sparkling WordPress theme

Hi @glewe,

To help us keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/sparkling/ instead of replying on others thread as it makes the thread messy and hard to read.

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.

Thanks,
Movin

Hi Movin,
I am sorry. Of course I will do so. I left this here because it is related to the topic and your earlier response.
Apologies and best regards,
George

No issue George. We will definitely help you on your new topic.

Hi!! I’m trying to download the pluging colorlib-plugin.php_.zip (attached) but I get the message Sucuri WebSite Firewall - CloudProxy - Access Denied.
Can you help me, please?

@gustavofalima You can download it from this reply.

This is confusing to me. When I add this code, the posts disappear in my design view. To be clear, I can’t even see them from the WordPress dashboard. However, they are still accessible to the user. I would also like to see no trace of these posts on the production site, except for their role as a slider. Please advise.

@oneillg You can try achieving this by using the attached modified plugin that contains following code but please note if the user accesses post URL directly in the browser then the user can access the post.

function exclude_category( $query ) {
	if( of_get_option( 'sparkling_slider_checkbox' ) == 1 && !is_admin() && $query->is_main_query() ){
		$slidecat = of_get_option( 'sparkling_slide_categories' );
	        $query->set( 'cat', '-'.$slidecat );
	}
}
add_action( 'pre_get_posts', 'exclude_category' );

You can also use pages for the slider instead of posts by using the solution posted in the following topic.

https://colorlibsupport.com/t/slider-for-pages/#post-33351

The above function also worked for me, thanks!

@trys You are most welcome here :slight_smile:

I would like to direct slider link to a page instead of a post. Is it possible to do it? If so, would you please help about this?

Thanks in advance…

@ce6449 To help us keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/sparkling/ instead of replying on others thread as it makes the thread messy and hard to read.

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.

Hi,
My concern is

I DO NOT want the slider to show up on the posts page.

I ONLY want the slider to show up on the home page. And if image clicked then return back to home page or redirect to another link.

Rajesh

@rajeshchugh Why have you relied here?

Didn’t you see my previous reply posted above where i requested all to create new topic instead of replying in this topic?

Hi Movin

I have the same issue as tomkennedy. I’m using the child theme.

I don’t want my ‘slider post’ to show up as a post: I am only using it to set a single slider image. I want my home page to display a single slider image, a sticky post, below that, post summaries.

I added the code you provided to my child theme functions.php file, but it has not had any discernible effect.

I tried making the slider post private, but that seems to prevent the featured image being used as a slider image.

I am very new to all of this so I am not sure I added the code correctly. Could you confirm I have put it in the right place?
<?php
// Add your custom functions here
function exclude_category( $query ) {
if( ! is_category() && of_get_option( ‘sparkling_slider_checkbox’ ) == 1 ){
$slidecat = of_get_option( ‘sparkling_slide_categories’ );

    if (  $query-&gt;is_main_query() ) {
        $query-&gt;set( 'cat', '-'.$slidecat );
    }
}

}
add_action( ‘pre_get_posts’, ‘exclude_category’ );
//

Any advice gratefully received!

Huge apologies Movin, I only just read your request to create a new topic. Please ignore my question.

@continentaldrift Not an issue. We would be more than happy to help you on your new thread.