WordPress.org

Forums

WP Tiles
[resolved] link to pages (2 posts)

  1. artanis81
    Member
    Posted 1 year ago #

    Hi, nice plugin!

    I would like to link a tile to a specific page, on the page I have a slider.
    I would also like the tile to select the first image of the slider.

    How do I do these things?

    Friendly regards,

    Lieuwe

    http://wordpress.org/plugins/wp-tiles/

  2. Mike Martel
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Lieuwe,

    Linking to a specific page can be done with some custom code, found in this gist. Use it to set up custom places in your tiles for custom pages.

    To make WP Tiles use the first image from the slider, you'd need to use the available filter pre_wp_tiles_image. If you return the src of the image, WP Tiles will show that particular image instead of the featured / first image. Do something like this:

    add_filter( 'pre_wp_tiles_image', 'wp_tiles_use_slider_image', 10, 2 );
    function wp_tiles_use_slider_image( $ret, $post ) {
        // Test if the post has a slider
        if ( POST HAS SLIDER? ) {
    
            // Get the slider image here
            $ret = SLIDER IMAGE;
    
        }
    
        return $ret;
    }

    Good luck!
    Mike

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Tiles
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic