Site logo

Archived topic

Widget Titles

3 replies · Started by Bobby on October 26, 2016

Viewing posts 1–4 of 4

Hello Tom,

I have a quick question. I was looking through the theme add-on features to see I could make my widget titles and blog sections look like the sample scree shot below:

http://playerwags.com/wp-content/uploads/2016/10/sample-widget-area.jpg

You see how each blog section and widget has a different title tag with the line connecting to the end of the widget container......

I found this forum question and response below, but I don't know if this would apply to what I'm trying to accomplish..

https://generatepress.com/forums/reply/202899/

I'm assuming this is something that would have be specifically customized via CSS and the theme files??

It'll take a little more than that, but it's do-able:

add_filter( 'generate_start_widget_title','tu_add_span_widget_title' );
function tu_add_span_widget_title()
{
      return '<div class="widget-title"><span>';
}

add_filter( 'generate_end_widget_title','tu_add_span_widget_title_end' );
function tu_add_span_widget_title_end()
{
      return '</span></div>';
}

Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

.sidebar .widget .widget-title {
    border-bottom: 2px solid #000;
}

.sidebar .widget .widget-title span {
    background: #000;
    color: #FFF;
    padding: 0 5px;
    display: inline-block;
}

Adding CSS: https://generatepress.com/knowledgebase/adding-css/

Hope this helps :)

That worked!! Thank you so much.

You're welcome :)

This archived topic is closed to new replies.