WordPress.org

Ready to get started?Download WordPress

Forums

Network Latest Posts
Display titles without h3.nlposts-ulist-title (5 posts)

  1. snapalot
    Member
    Posted 1 year ago #

    Hi there

    I want to display post titles without the h3 tag of class nlposts-ulist-title.

    Instead of

    <ul class="nlposts-wrapper nlposts-ulist nav nav-tabs nav-stacked">
       <li class="nlposts-ulist-litem nlposts-siteid-163">
          <h3 class="nlposts-ulist-title">
             <a href="{url to post}">Post title</a>
          </h3>
       </li>
    </ul>

    this should be the structure

    <ul class="nlposts-wrapper nlposts-ulist nav nav-tabs nav-stacked">
       <li class="nlposts-ulist-litem nlposts-siteid-163">
          <a href="{url to post}">Post title</a>
       </li>
    </ul>

    Is there an easy way to do this without modifying the plugin?

    Plan B is to write heaps of CSS to make it look different, but then the style.css becomes bloated.

    Thank you

    http://wordpress.org/extend/plugins/network-latest-posts/

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Kobus,

    There's only one way to do so without modifying the code. You could use jQuery for that, you'll need to create a JavaScript file save it to your theme's folder then load it from your functions.php.

    Name your JavaScript file: unwrap-nlptitles.js

    Add this to the file:

    <script type="text/javascript">
         jQuery(".nlposts-ulist-title a").unwrap();‚Äč
    </script>

    Then to your functions.php:

    wp_enqueue_script('unwrapjs',get_stylesheet_directory_uri().'/unwrap-nlptitles.js';

    That'll remove H3 tags, I'm working on a better way to handle HTML wrappers for future releases, but it's still on development. jQuery is the cleanest solution so far.

    Regards.

  3. landauforte
    Member
    Posted 1 year ago #

    Hey Jose

    Just another request for this feature please. I am including a list of news items within a page under existing h3 tags. It would be nice (and more semantic) if you could provide a way to either disable the use of h3 tags or a way to use an alternative, div for example, should the user require it.

    Awesome plugin. Very useful for us.

    Cheers,
    James

  4. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    Hello James,

    Thank you for your comment, I'm working to add theming support to this plugin. Themes will give you the ability to display elements the way you need. I'll let you know once the new version is available.

    Cheers.

  5. landauforte
    Member
    Posted 1 year ago #

    Hi Jose

    Sounds great. Looking forward to seeing the finished update.

    James

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic