Support » Plugin: Posts in Sidebar » Displaying plugin not in widget area

  • Resolved astandera


    Dear sirs,
    thank you for the plugin. I am using it in a very simple way: 1 post, text only, one short sentence and I am looking for a help.

    My theme has a widget area in sidebar STARTING BELOW sidebar SECONDARY MENU, so unfortunately my post from the plugin can be shown BELOW that menu.

    And my question: IS ..there a way to show it ABOVE that menu? It is not widget area, but in sidebar. Any way using SHORTCODE or … I am sad :-/

    Visually: There is a webcam picture in left sidebar and I need to show the text from the plugin just below it:

Viewing 5 replies - 1 through 5 (of 5 total)
  • SOLVED, hardcored 🙂 If you are interested, how to. I changed my theme a bit instead of changing the plugin, but easily, to get the plugin post to the right position in template, which was nonwidget area.

    1. Enabled PHP functionality to work from a plain Text/HTML widget, the guide is here and easy, no plugin reuired:

    2. Cut PHP code of my Sidebar Menu hardcoded by the autor in nonwidget area 🙁 from the menu-secondary.php file in template folder and this code I Pasted into normal Text/Html widget (with the PHP code enabled in the point 1.).

    3. This TXT/HTML widget was dragged in the right order in Widgets.

    4. I was playing with plugin setup and my own CCS rules to format it.

    So that, i can have Posts in sidebar under my webcam here, top left blue rectangle with an icon. Icon is small pic 25 px of width enabled in plugin as Show Thubnails.

    Thanks to the author and community for keeping plugin alive it’s very useful.


    Plugin Author aldolat


    Hi astandera,
    to display the Posts in Sidebar widget before that menu you have to edit the files of your current theme. I’s a bad choice to do this because, if the theme is updated, you should re-add the modifications to the updated files. The good choice would be to create a child theme.

    Anyway, here’s my solution. I downloaded your theme (Oxygen) and made the following changes.

    1. File functions.php

    Open the file functions.php and add these lines just before the ending PHP tag ?>:

    function pis_widgets_init() {
    	register_sidebar( array(
    		'name' => __( 'PIS Sidebar', 'oxygen' ),
    		'id' => 'sidebar-pis',
    		'description' => __( 'Appears in left sidebar, on top of the secondary menu.', 'oxygen' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    add_action( 'widgets_init', 'pis_widgets_init' );

    Save the file.

    2. File menu-secondary.php

    Open the file menu-secondary.php and just before this line:

    if ( has_nav_menu( 'secondary' ) ) : ?>

    add these lines:

    if ( is_active_sidebar( 'sidebar-pis' ) ) : ?>
    	<div id="sidebar-pis" class="widget-area" role="complementary">
    		<?php dynamic_sidebar( 'sidebar-pis' ); ?>
    	</div><!-- #secondary -->
    <?php endif;

    Save the file.

    Now go to your widgets panel and you’ll find a new sidebar, with the name PIS Sidebar. In this sidebar drag and drop a new Posts in Sidebar widget.

    Go to yous site and test the result.

    Hope this helps. Let me know.

    Plugin Author aldolat


    while I was writing the reply, you were replying! 🙂

    I’m happy you solved so quickly!


    Dear “Aldolat”,
    thank you for taking an effort to help me. Your solution is also not “theme update resisted”, BUT much more less dangerous and sophisticated, that mine is, so I will probably follow yours.

    It has to be a passion to keep the plugin alive, and also to help the others to replay their “how to” questions.

    I am repeating again: I appreciate your effort, the plugin is very useful.

    Thank you

    Plugin Author aldolat


    Thank you for your kind words! 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Displaying plugin not in widget area’ is closed to new replies.