WordPress.org

Forums

WP Tiles
How to add tiles to index.php (2 posts)

  1. iUzbak
    Member
    Posted 1 year ago #

    Hello,
    i want to add wp tiles to my index.php homepage with php code
    i try to to add `<?php if ( function_exists ( 'the_loop_wp_tiles' ) ) the_wp_tiles( array(
    'template' => 'MyTemplateName'
    ) ); ?>and<?php if ( function_exists ( 'the_loop_wp_tiles' ) ) the_wp_tiles( ); ?>`
    but is not working ! i using the wptiles 1.0 beta version.
    please help me ?

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

  2. Mike Martel
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there! Thanks for testing the 1.0 beta version of WP Tiles.

    Are you trying to replace the loop with WP Tiles? In that case replace the_wp_tiles with the_loop_wp_tiles in your snippet above. So:

    <?php if ( function_exists ( 'the_loop_wp_tiles' ) ) the_loop_wp_tiles( ); ?>

    The workings of the template tags (the_wp_tiles() etc.) has changed a bit in the new version and I haven't gotten around to documenting it completely yet, but it should be compatible with the old ways, and the above snippet should work.

    If the above doesn't work, you can continue debugging as follows:

    1) Make sure that the WP Tiles plugin is activated
    2) Use the [wp-tiles] shortcode somewhere to make sure that there are no compatibility problems with your theme
    3) Make sure that index.php is actually the template that is being used. Use Debug Bar for this, or add something unmistakable to index.php (like <h1>If you can read this, it worked!</h1> or something). Your choice.
    4) If all the above are correct, the Tiles should show using the template tag.. post back here if it's still not working.

    Cheers,
    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

Tags