Widget or Plug-in? Building a theme and unsure how to approach optional content

I have a question regarding how best to build a widget/plug-in for WordPress.

I have tried to code this thing out but unfortunately to no avail but that’s because I’m increasingly thinking I’m going about it the entirely wrong way.
This is what I’m trying to achieve:

Read More

I have built a theme from scratch. In this theme I have two content areas. The larger of the two contains the main content and the smaller of the two (proposed widget/plug-in) contains supplementary information (opening times, Facebook feed). I don’t want this widget/plug-in to appear on every page and would like the ability to turn it on or off within the usual WordPress admin area.

The impression I am getting is that I can build the widget that contains the content I want (with necessary forms to change said content) but it is either on for ALL pages or off for ALL pages, no sort-of page specific functionality. That’s where I’m thinking a plug-in would extend the functionality and allow me to be more page specific with it. That is my current set-up with a theme I’m running and plug-in I added (neither of which were coded by me) but I would like to repeat it as best as possible.

Would it be right to assume that widgets are not really designed to have page specific functionality and that function should be left down to a plug-in?

I appreciate this question asks nothing really in the way specific advice but I would just like an opinion or two on the best approach before I go away and create it – this is my main struggle at the moment.

Thanks for looking.

Related posts

Leave a Reply

2 comments

  1. This can be done with the Jetpack plugin. Once activated you can choose what widgets display on what pages:

    The Widget Visibility module enables you to configure widgets to appear only on certain pages (or be hidden on certain pages) by using the Visibility panel.

    enter image description here

    Visibility is controlled by five aspects: page type, category, tag, date, and author. For example, if you wanted the Archives widget to only appear on category archives and error pages, choose “Show” from the first dropdown and then add two rules: “Page is 404 Error Page” and “Category is All Category Pages.”

    enter image description here

    Originally posted here

    It is also possible with the Display Widgets plugin.