• Hello

    I can’t get the widgets working on my site. https://www.dpfoto.com
    I can enable all the plugins and enable the widgets on the plugins page in wp administration. But I can’t get them on the sidebar. It seems I have a widget enabled theme since I have functions.php with the correct code and also the sidebar code including dynamic_sidebar.
    I have a pretty messed up front page in WP administration for some reason aswell.

    Please help me to configure the widgets. I’m using the Qwilm theme.
    Thanks!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Lionheart

    (@lionheart)

    I got the widgets to work. I think it was sonething with the permission on the server. But now it works.

    I have another question. Is there a way for the widgets to co-exist with the sidebar content instead of replacing them. I really would like the Welcome text I have and the META and Last comments on sidebar 2. But if I add a widget this content is replaced. Can I add a sidebar 3 or add blank space in the sidebar to make room for some widgets.

    Look at my site https://www.dpfoto.com to see what I mean.
    Thanks!

    Thread Starter Lionheart

    (@lionheart)

    Is there somebody that can answer this one?
    Regards
    Dennis

    When I installed the widgets plugin, my theme wasn’t widget enabled. I had to code the templates to accommodate the widgets information, as well as change the function.php to reflect my many and varied sidebars which I use throughout my site.

    From what I can gather, you don’t wish to replace existing information in your sidebar with the widget plugin, merely display the widgets generated text and/or links beneath or above existing content?

    I found placing the code really easy to do. I just selected an area in my sidebar and hard coded in an asides div to contain the widgets html output. I decided I would use only one [div class and/or id] for this global placement and use it throughout the site on multiple sidebars. Any id or class name will do.

    The beauty is no matter where you put it (sidebar), if you declare margin-top to be, say, 50px from the ‘top’ it will always be 50px from anything that is directly above it, and that includes existing content and/or links.

    So it can be switched around within the sidebar to sit at the very top or absolute last in the sidebar colum, and always retain 50px gap between information or text. Naturally, declaring margin-bottom may be useful, too.

    something like:

    [div id=”rightcol”]
    [div id=”rightnav]
    [ul]
    [li]link[/li]
    [/ul]
    [/div] close rightnav

    [div class=”asides”]
    [div id=”text-1″ class=”widget widget_text”]
    [p class=”subheading”]snappy line here[/p]
    [ul]
    [li]widget link[/li]
    [/ul]
    [/div] close text-1 – automatically inserted by plugin
    [/div] close asides – hard-coded
    [/div] close rightcol – hard-coded

    In the template file, I hard coded the [div class=”asides”] then inserted directly after the opening html call, the dymanic function for the widgets. I closed the [div] (hard-coded) after the function.

    In the functions.php I changed the output as per instructions…

    {
    register_sidebar(array(
    'before_widget' => '[div id="%1$s" class="widget %2$s"]',
    'after_widget' => '[/div]',
    'before_title' => '[p class="subheading"]',
    'after_title' => '[/p]
    ',
    'name'=>'articles-sidebar',
    ));

    Does that help?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Lionheart: The best way is to move the content you already have in the sidebar into Widgets. Look at the widgets available at https://widgets.wordpress.com and see if there are widgets that do what your existing sidebar content does.

    For straight text or HTML content in your sidebar, the built-in Text widget comes in handy, as you can just paste the text or HTML into the widget and position it on the sidebar however you like.

    And for those bits of code that you just can’t find a replacement for, there’s the ExecPHP widget I wrote. It’s just like the Text widgets, but you can put PHP code into them and it will run just like before.

    The advantage of doing it this way instead of mixing an old-style sidebar with widgets is that by going all widgets, you can move everything around and reposition easily. Also, if you change themes, your sidebars come with you without any editing.

    I see your point… will consider flexiblity issue

    edit: old style sidebar is probably that; old style, although what was up to the minute yesterday is also probably old today.

    Interestingly enough, I did consider deleting all html out of my templates and using widgets like crazy.

    But I also considered permanent html that doesn’t change – like navigational stuff and branding logo. So I guess it just depends on how portal or flexible one needs to be?

    And, dare I say it? I really like coding and challenging myself to get things looking right in all browser.

    I know… I know… call me mad… ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can’t get my widgets to work’ is closed to new replies.