Forums

How do I create a widget area before a part of my template? (7 posts)

  1. muchacho79
    Member
    Posted 10 months ago #

    If I understand this correctly, you can create a widget space which you can make appear after a specific DIV tag in my content.

    I'd like this widget to appear immediately after the final word of my articles/posts. I've tried inserting the widget using after the post, but it appears below the 3 plugins that appear under each post. I want it to be above those 3.

    How do I go about doing this?

    So the site would look like:
    {Post Title}
    {Post Main Content}
    {My created widget} <<<
    {Author Box Plugin}
    {Related Posts Plugin}

  2. Seacoast Web Design
    Member
    Posted 10 months ago #

    With a page template and this help page.

  3. alchymyth
    The Sweeper & Moderator
    Posted 10 months ago #

    as most of these plugins are using a filter function to hook themselves to the end of the content, you possibly need to do the same with your 'sidebar' aka widgets space, just with a higher priority.

    example to be added to functions.php of your theme:

    http://pastebin.com/HjcU6v1m

    http://www.php.net/manual/en/function.ob-get-contents.php
    http://codex.wordpress.org/Function_Reference/add_filter
    http://codex.wordpress.org/Function_Reference/register_sidebar

  4. Seacoast Web Design
    Member
    Posted 10 months ago #

  5. alchymyth
    The Sweeper & Moderator
    Posted 10 months ago #

    @Seacoast Web Design

    Will you update your own websites advise on this now, Al?

    imho, these are slightly different cases;
    this topic refers to a 'widget section' directly at the end of the post content, specifically before any plugin injected other codes.
    my site - which you quoted - refers generally to creating a new widget area, for instance in the header, or possibly after the content div.

    let's hope @muchacho79 will get back to confirm that the suggestion is working...

  6. muchacho79
    Member
    Posted 10 months ago #

    Many thanks for the replies. I like the way it goes into explain what each part of it means as well.

    I'll work on this in the next couple of days and reply again with how I get on.

  7. Seacoast Web Design
    Member
    Posted 9 months ago #

    OK, Al, thanks for clarifying.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.