Sidebar: Ways to Edit Widgets in WP

I have this sidebar and a bunch of widgets with links and <hr> divider lines.
The goal is to remove some link groups from some pages, as well to remove extra <hr> lines.

Sometimes a page would not have any widgets associated with it (Customize > Widgets on that page).
But the link groups and extra divider lines are still there.

How do i remove them? Do I need to check what’s in those php loops, or maybe functions.php?

I have tried assigning widgets to different pages, and removing extra widgets, but those lines and links are still there. Does this mean I hove to look at the code or there a way doin g doing in through WP Admin Dashboard?

Example: please see image - the extra line is in the right top sidebar

Any ideas?


Thank you.

This will probably require editing your theme. Your best bet is to make a child theme and override the template that’s causing it.

You can create a child theme with a plugin if you don’t want to do it manually.

I usually copy the entire template I want to change into my child theme. In your case, I’d then open that template in the child theme and edit what you need to. Two different approaches you might take: you can add conditional logic to the template so that the <hr> only gets added if you have widgets, or you can remove it altogether and use a border on your widget elements to create the line. I like the latter method a bit better, but either could work.

1 Like

Thank you for such a detailed answer. That makes it a lot more understandable.
The plugin is a cool tool as well. I’ll give it a try, just in case I get lost when I’m building a theme from scratch. This gives something to compare it with.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.