WordPress.org

Ready to get started?Download WordPress

Forums

Detect if archive dropdown is checked (2 posts)

  1. onebitrocket
    Member
    Posted 1 year ago #

    Hi I want to replace the default <select> box that echos out if the check box is ticked in the archives widget.

    I've created a for each function that selects a distinct year and echos out the dropdown select box with options for each of the distinct months for that year, where posts exist

    I assume I need to override the default-widgets/php function for the archive widget, but I'm not sure how.

    Can anyone shed any light on this?

    Thanks

  2. bcworkz
    Member
    Posted 1 year ago #

    You pretty much need to create you own custom archive widget in a plugin, then remove the default from your blog via the widget control panel and replace it with your custom version. Of course, you would probably want to copy the default version into your plugin code and edit that, rather than create a widget from scratch.

    Alternately, you might consider creating an archive template instead of using a widget. Not a solution for everyone of course.

Topic Closed

This topic has been closed to new replies.

About this Topic