Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other AnythingSlider Slides generated by WordPress with Navigation text

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #32236
    swirv
    Participant

    I figured out how to get WordPress to not only generate the slides but set the title as the navigation text. I thought I would share this with the community.

    In my example I am using the thumbnail from the post as the slide content.



      $my_query2 = new WP_Query();
      $my_query2->query( array('post_type' => 'our-communities' ) ); //Custom post type
      while ($my_query2->have_posts()) : $my_query2->the_post();
      ?>

    • ">


    • $slideTitle = the_title(''', '', ', false);
      $sliderText .= $slideTitle;

      endwhile; ?>



    The ‘null’ item I put in the slider2 variable was because I did not know how to get comma separated titles and not give the last one a comma. The comma on the end would break the Javascript. I am sure there is a better way. If so, feel free to let me know. :)

Viewing 1 post (of 1 total)
  • The forum ‘Other’ is closed to new topics and replies.