WordPress.org

Ready to get started?Download WordPress

Forums

links widget - add a divider between each link (3 posts)

  1. Sean
    Member
    Posted 2 years ago #

    I've added the links widget to a non-sidebar area (for lack of a better term -- I'm pretty new to the WordPress platform) that displays links for a specific category and limits the count to 12. Basically, I publish a PDF document once a month and want the link to the PDF displayed in this list and limiting it to only the previous 12 months.

    I've figured out how to style the category name, but I want to add a divider between each link in the list.

    <div class="divider> </div>
    

    This is the php code I'm using for this purpose:

    function widget_links_args_filter($args) {
    	$args['order'] = 'DESC';      // descending
            $args['limit'] = 12;
    	return $args;
    }
    add_filter('widget_links_args','widget_links_args_filter');
    
    the_widget('WP_Widget_Links', 'category=26', 'before_title=<h5>&after_title=</h5>');
    

    Will someone please help me with this? Gracias!

  2. munrobr
    Member
    Posted 2 years ago #

    I'm not 100% positive if this is what you're after, but you wanted to use css to divide each item you could break it up with an unordered list. Just a ul and an li. Then the border-style css element could separate the li items.

    Hope that helps!

  3. Sean
    Member
    Posted 2 years ago #

    Hi munrobr,
    Well, yes... that's essentially what I'm after. My "divider" class is defined in css. I just need to know how to add it to this php function. I want it done automatically when I add the links in the blogroll. I don't want to have to go and manually make the change every time I publish my PDF.

Topic Closed

This topic has been closed to new replies.

About this Topic