• Hello!

    It’s something against which I’m struggling, so please pardon the awkard description, I’m really doing my best.

    Let’s imagine a wordpress blog, not with a “magazine” presentation, with an old school presentation, for whom the Home page is made of 8 posts, with their content above the <--more--> tag shown in the Home page, one post after the other, till the bottom of the page.

    I would like to be able to widgetize the areas BETWEEN the posts.
    A widget “between post #1 and post #2”
    A widget “between post #2 and post #3”
    A widget “between post #3 and post #4”

    And, as such, those widget areas will become manageable like any other widget area.

    Please, would you know HOW that can be achieved ?
    I’m open to hand-editing code, I’m not comfortable enough around php to create from scratch, but I can understand and handle it once I have the usable bits 🙂

    (Oh, if you wonder. The reason for my plea for help is: a massively bulk-stacked sidebar on an old non-responsive made-for-desktop wordpress theme.
    When the website is viewed on a display triggering the responsive behaviour, the sidebar will be gone. At that moment, some of the sidebar’s contents will be taken and tossed inside those widgets, instead of having the entirety of the sidebar contents hidden in a Navigation menu the visitor would have to open manually by clicking a Navigation button.)

    I don’t even know if that can be achieved, but I have good hope, thank you VERY MUCH if you can help ! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Sabinooo

    (@sabinooo)

    I allow myself to respond within my own thread, I found a bit of the reply, I now know how to differentiate the space between each spot.

    The answer came from that thread: https://wordpress.org/support/topic/inserting-ads-between-every-5th-post?replies=5

    For instance, to insert code between posts #5 and #6 :

    <?php $postnum++; if($postnum%5 == 0) { ?>
    (just a test ^^)
    <?php } ?>

    It can be tweaked with if($postnum == 1) and such.

    And it must be inserted just before
    <?php endwhile; ?>

    Now, please, may I humbly ask for assistance with the creation of a widget zone ?

    I’ve read documentation, the official one that totally lost me, and other pages such as this one, that other one, or this one, or one for footer widgets.

    One thing is troubling me to no end, please could you confirm me that even for widgets that will NOT be in a sidebar (here: between posts loaded on the index.php page), we must still start, in functions.php, with a “register_sidebar” ?

    I know it sounds naive, but in my eyes, that’s weird O_o

    I don’t know yet which theme will have an addition of widgets. Could be the Canvas theme from Woopress, or any other mainstream recent theme.

    Sorry to be a bother with those questions :-/

    we must still start, in functions.php, with a “register_sidebar” ?

    yes. ‘sidebar‘ is just a synonym for ‘a place to show widgets‘.

    review https://wordpress.org/support/topic/insert-sidebars-between-posts-how-do-i-code-this-in-my-indexphp?replies=3

    you can also try and use the ‘the_post’ hook to add an action to output widgets – this would work without editing the templates which contain the loop.

    code for functions.php:
    example for one sidebar after post 1 in the loop of the index page for a child theme of Twenty Fifteen:

    http://pastebin.com/7vpB3NXQ

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is it possible to add new widget zones, specifically between posts #x and #y ?’ is closed to new replies.