Single Latest Posts Lite
Styling Output (3 posts)

  1. red.rover
    Posted 3 years ago #

    I'm wanting to give the

    • elements a few additional bits of data so that it is styled by jQuery mobile - is there a way to affect output of the list at all?


  2. red.rover
    Posted 3 years ago #

    Whoops it turns my <ul> and <li> into code haha.

  3. Jose Luis SAYAGO
    Plugin Author

    Posted 3 years ago #

    Hi, well it could be done using jQuery selectors to add missing elements. However, I'll keep your idea in mind for future releases.

    To be more specific about selectors, here's an idea:

    1.- Create a custom script which you can call nlposts-jqmobile.js for example, save it to your theme root folder then add something like this:

    		"data-role": "listview",
    		"data-inset": "true",
    		"data-scheme": "a"

    2.- Load the script from your theme's functions.php file, like this:

    function nlposts_jqmobile() {
                   get_template_directory_uri() . '/nlposts-jqmobile.js',
    add_action( 'wp_footer', 'nlposts_jqmobile' );

    That's it, now lists should look like:

    <ul class="nlposts-wrapper nlposts-ulist nav nav-tabs nav-stacked" data-role="listview" data-inset="true" data-scheme="a">
         <li class="nlposts-ulist-litem nlposts-siteid-1">...</li>
         <li class="nlposts-ulist-litem nlposts-siteid-2">...</li>

    If you want to add attributes to LI elements you can repeat the same operation but selecting li classes instead of ul ones.

    Hope this help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Single Latest Posts Lite
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic