Home › Forums › Pro Support › Enable link in widget title
Tagged: widget title link
- This topic has 5 replies, 2 voices, and was last updated 2 years, 2 months ago by
elvin.
-
AuthorPosts
-
September 15, 2021 at 5:04 am #33838
Simon
ParticipantHi Tom and team
I am using WP Show Posts pro, with GeneratePress, GP Premium and the ‘Dispatch’ template.
In an individual post, I am using WPSP to create a custom Sidebar widget to list posts from the same category. All listed and working OK.
What I want to ask is how to make the WPSP sidebar widget Title into a link – in this case a link to the category page.
(To try to solve it, I installed the plugin: Simple Widget Title Links, which produces the right back-end boxes for entering the title link. But there is no sign of the link at the front end, or even in the code. Perhaps it is blocked by WPSP.)
Do you have a WPSP solution? Am I missing something?
I ask because the widget title, which says “XXXXX posts”, would be a good place to link to the XXXXX category page with all those posts. If that’s difficult, an alternative would be to activate the post meta as a link to the category page. At the moment I have no direct link from an individual post to the category page.
Please advise. Thank you.
September 15, 2021 at 10:20 pm #33866elvin
ModeratorHi there,
If you’re using WordPress v 5.8, the Widget area lets you add custom HTML.
I suggest manually adding a Title through custom HTML and then add the WPSP shortcode block below it.
This way you have full control on how the widget title will behave. 🙂
But I’m not exactly sure if I got what you mean. Just in case, can you link us to the page in question?
September 18, 2021 at 2:03 am #33931Simon
ParticipantElvin – Thank you.
I have created a manual H2 Title as you suggest, and then used the Widget CSS Classes plugin (installed as part of the Dispatch template) to give it a custom CSS class that sets the bottom margin to zero, so that each heading is close to what follows.
Solved!
September 18, 2021 at 8:13 pm #33956elvin
ModeratorGood one! Glad you got it sorted. No problem. 😀
September 19, 2021 at 4:53 am #33972Simon
ParticipantSorry – I realise it’s not solved in that way.
CSS classes applied to widgets only apply to the <p> or <h2>, not to the widget itself. (And if the widget is html, I can’t set a class for it.)
So by making the header a separate widget from the WPSP list, as you suggest, the margin-bottom and padding-bottom that apply to every widget also come between the heading and the WPSP list.
For now I have set CSS at least for the first and odd number widgets, hoping to catch all the headers:
.is-right-sidebar .widget-first, .is-right-sidebar .widget-odd { margin-bottom: 0; padding-bottom: 1px; }
The only alternative is to apply those settings for all widgets, and then put a CSS class for margin-top for the h2 headers.
It would be great if a future version of WPSP could enable the header within the widget to be made a link.
Thank you.
September 19, 2021 at 8:15 pm #33987elvin
ModeratorWidgets normally have unique IDs. I believe you can target the heading you’ve specifically applied above the WPSP list w/ that. 🙂
But perhaps I’m missing the point. If that’s the case, can you link me to the page in question and provide a mockup of how you want things to be laid out?
-
AuthorPosts
- You must be logged in to reply to this topic.