• digitalmonkey

    (@digitalmonkey)


    Hi I’m having this problem where I want to a div as separator/ title for my widgets only I don’t know where to find the code for position of the widgets. This is what mean:

    ie:

    <h2>Search<h2> (have the title of the widget that is formed by the CSS instaed of the standard title font)

    next the widget; (search widget)

    followed by a div tag that’s a separator.

    and then a new title for the next widget

    <h2>New posts<h2>
    New post widgets
    separator div tag

    and so on.. ??

    Is there a way of doing this within the sidebar php? Or anyway of doing it at all?

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi

    (@esmi)

    Best achieved using the before_widget and after_widget parameters for register_sidebar in your theme’s functions.php.

    https://codex.www.ads-software.com/WordPress_Widgets_Api/register_sidebar

    Thread Starter digitalmonkey

    (@digitalmonkey)

    thanks Esmi! however most of that in the link went right over my head. I tried to add the div tag in the after_widget part but it just went crazy and returning a syntax error. I hope it’s not too much to ask for a step by step guide.

    also I want to do some editting to title font size but so that it has different font styles. here’s what I mean.

    I want the font to be formatted like this:
    <h3><‘strong’>Search</’strong’> all posts</h3> splitting up the first and second words with the first being in bold. this is the code but I don’t know how to automate it.

    'before_title'  => '<h2 class=\"widgettitle\">',
    'after_title'   => '</h2>' ); ?>
    'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s\">',
        'after_widget'  => '</li>',

    also after ”should I add the div tag?

    thx

    Thread Starter digitalmonkey

    (@digitalmonkey)

    Is there a way just to edit the order of the widgets like a html where the ones you add are actually in the code. That seems the easiest way of me to edit them individually.

    Thread Starter digitalmonkey

    (@digitalmonkey)

    okay I screwed up the file after put the div in.

    <?php
    if ( function_exists('register_sidebar') ) {
       register_sidebar(array(
           'before_widget' => '<li id="%1$s" class="widget %2$s">',
           'after_widget' => '</li>''<div class="hr"></div>',
           'before_title' => '<strong><h3 class="widgettitle">',
           'after_title' => '</h3></strong>',
       ));
    }
    ?>

    I keep getting this error where ever I put it: Parse error:

    syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘)’ in /functions.php on line 5

    and unable to access the dashboard after. I know I can easily fix the error by rewriting it with the original and ftping it up but I don’t know where to put the div for inclusion.

    Thread Starter digitalmonkey

    (@digitalmonkey)

    bump :0

    Michael

    (@alchymyth)

    the last komma seems to be too much:

    </h3></strong>',

    Thread Starter digitalmonkey

    (@digitalmonkey)

    I’m not sure what you mean alchymyth, do you mean I have to remove the last comma? Or something else.

    Michael

    (@alchymyth)

    yes, take it away, it seems to indicate that enother array element is following, which is not.
    so it should look like this:

    </h3></strong>'
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How edit the location of sidebar widgets?’ is closed to new replies.