WordPress.org

Forums

Customizr
[resolved] Move slider on blog post (5 posts)

  1. abollmeyer
    Member
    Posted 1 year ago #

    I have been very impressed with this theme. Very easy to use right out of the box! I do have one question however. How can I move the slider on my category pages so that it appears below my blog title but before the comment section?

  2. rdellconsulting
    Member
    Posted 1 year ago #

    Try this Snippet

  3. abollmeyer
    Member
    Posted 1 year ago #

    Thanks for the reply rdellconsulting. However, I have looked at that page as well as this .

    This moves the slider accordingly on the home page when I cut and paste the snippet into my functions.php file.

    However, the slider on the category page remains the same. I think I need a little more info on how to do this if it is possible.

    Thanks for listening.

  4. abollmeyer
    Member
    Posted 1 year ago #

    add_action ( 'wp_head' , 'place_slider_before_footer' );
    function place_slider_before_footer() {
        if ( !tc__f('__is_home') )
            return;
        remove_action( '__after_header' , array( TC_slider::$instance , 'tc_slider_display' ));
        add_action( '__before_footer', array( TC_slider::$instance , 'tc_slider_display' ));
    }

    It looks like the part I need to change is (!tc_f('__is_home'))...I've tried replacing home with category, post, and page. Not sure what I am missing here.

  5. abollmeyer
    Member
    Posted 1 year ago #

    Figured out one way to do it, but don't know how it will affect me in the future. Basically, I couldn't find an action hook that specifies a post or category page (not sure which I would need anyway). Keep in mind this is all new to me. But I found I could achieve the look I wanted by saying if NOT on the home page, then put slider below content.

    //Places slider below content and above comments if not on home page.
    add_action ( 'wp_head' , 'place_slider_after_content' );
    function place_slider_after_content() {
        if (!( !tc__f('__is_home') ))
            return;
        remove_action( '__after_header' , array( TC_slider::$instance , 'tc_slider_display' ));
        add_action( '__after_content', array( TC_slider::$instance , 'tc_slider_display' ));
    
    }

    Thanks for the input rdellconsulting.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.