-1

im using a sidebar widget in homepage for an extra gallery. sadly it appears in every pages ._. thanks in advance

  • Please take a look at the Template Hierarchy to figure out where you want that sidebar to appear and where not. Then read How to Ask to see how you can make your question answerable. Thanks. – kaiser Jan 25 '15 at 9:13
0

Simple, quick option: use a plugin called "dynamic widgets"; it provides an interface the where you can specify the conditions under which each of your widgets should appear.

Slightly more involved option is to edit your theme, so that it has two sidebars, both registered as widget areas, and include one of them only on the front-page.php (if you have a static front page), or home.php (if you have a blogfeed front page).

| improve this answer | |
  • looks cool! let me see – Ds.sorosh Jan 25 '15 at 8:25
  • Worked Awsome. ty – Ds.sorosh Jan 25 '15 at 8:33
  • sure dude it was on cooldown! :D – Ds.sorosh Jan 25 '15 at 8:35
  • Answers should be more than plain links. They should actually be an answer instead of a route where someone will maybe find an answer. Please help preventing link rot, edit your answer and provide the needed information that helps the OP as well as later visitors to solve their problem. – kaiser Jan 25 '15 at 9:14
2

writing a minimal plugin (´functions.php´) like this should do:

add_action('wp_head', function(){       
    if ( is_home() ) return; // on home it's okay

    unregister_sidebar('sidebar-1');
    echo '<style>
        .content-area {
            margin-right: inherit;
            width: 100%;
        }
        </style>';
}
| improve this answer | |
0

writing a minimal plugin (´functions.php´) like this should do:

add_action('wp_head', function(){       
    if ( is_home() ) return; // on home it's okay

    unregister_sidebar('sidebar-1');
    echo '<style>
        .content-area {
            margin-right: inherit;
            width: 100%;
        }
        </style>';
});

Of course, 'sidebar-1' and the counter-styling is template-specific (twenty sixteen in this case), needs adjustment to the theme you use.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.