• Resolved pajtai

    (@pajtai)


    I’d like to change a widget.

    In the Recent Posts widget ( class WP_Widget_Recent_Posts extends WP_Widget ), only at most 15 of the most recent posts are displayed. I’d like to increase this number.

    The variable in question is $number…. How do I change what this variable is set to? I don’t want to hard code it into the class.

    Should I make a personal plugin to change this? Not quite sure where to begin.

    Either an answer or pointing to relevant thread would be appreciated.

    There’s a few threads dealing with this issue, but I haven’t found one with a solution that doesn’t involve changing the code in default-widgets.php.

    Can I just re-write the recent posts widget class in the functions.php of my theme?

    Thanks,
    Peter.

Viewing 1 replies (of 1 total)
  • Thread Starter pajtai

    (@pajtai)

    Ok, I got it. I can just make a custom widget. You just have to make sure to initialize and register it.

    I just copy and pasted the code of the original widget into functions.php, changed its name, edited it as desired, initialized, and registered it.

Viewing 1 replies (of 1 total)
  • The topic ‘Changing variables with a plugin’ is closed to new replies.