Ready to get started?Download WordPress


Catch Box
Featured Slider - Link to page? (7 posts)

  1. firebirduk
    Posted 2 years ago #

    Hi guys, bit of a wordpress/catch-box newbie here, but I've managed to set up a front page 'featured slider' that links through ok to posts.

    However i'm trying to link to a page which I've set up, not a post, and it's not showing up (image missing) when typing in the ID of the page instead of the post under 'Featured Col #x'. There's an option to add in a 'featured image' in the page in question, which I've done.

    Is there any way to add to in a link to a page? Any help would be appreciated, many thanks.


  2. thestealthyfox
    Posted 2 years ago #

    I have exactly the same problem - has anyone come up with a fix for this?


  3. Snorker
    Posted 2 years ago #

    I also would like to link pages, not posts, through the slider. Please assist.

  4. Emielb
    Posted 2 years ago #

    I'm having the same request here! When adding an ID of a page, my slider doesn't show it. However the "Edit" button does redirect fine.

    I tried to enhance function catchbox_sliders() in functions.php, but couldn't make it work.

    Any help or suggestion would be very appreciated !

  5. Deadpan110
    Posted 2 years ago #

    Firstly the slider uses WordPress transients to reduce database queries - so you may be seeing a cached result.

    See line 744 in functions.php and uncomment:

    delete_transient( 'catchbox_sliders' );

    Secondly, you can add 'post_type' to the query (around line 757 in functions.php):

    $get_featured_posts = new WP_Query( array(
    	'post_type' => 'page',
    	'posts_per_page' => $postperpage,
    	'post__in'		 => $options[ 'featured_slider' ],
    	'orderby' 		 => 'post__in',
    	//'ignore_sticky_posts' => 1 // ignore sticky posts

    It would be nice if this array used a filter instead for use in child themes, maybe our friendly catch-box developer can add:

    $slider_query = apply_filters(
    		'posts_per_page' => $postperpage,
    		'post__in'		 => $options[ 'featured_slider' ],
    		'orderby' 		 => 'post__in',
    		'ignore_sticky_posts' => 1 // ignore sticky posts
    $get_featured_posts = new WP_Query($slider_query);
  6. Emielb
    Posted 2 years ago #

    It works great! Thank you very much Deadpan110! :-)

  7. jordpress
    Posted 1 year ago #

    hi! I'm trying to figure out how to do the same thing but for some reason it's not working -- there's a good chance I'm doing it wrong though! Could someone possibly please explain a bit more in depth how to do this? I tried pasting the above code into my CSS edits but got no result... was this the correct way to do it? If not can someone please explain this further to me? thank you!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic