Home > Forum

Support Forum

Hide widget on one particular page

Discussions related to the HTML Javascript Adder WordPress plugin.

Hide widget on one particular page

Postby neonrainmusic » Tue Jun 15, 2010 1:17 am

I'd like to hide the widget on one of my pages but there is no way to do this through the settings menu. Is there any code I could add to the files to allow me to hide the particular page?

http://www.neonrainmusic.com
That's the site and I'd like to hide the widget on the music page. I don't have the widget on right now because I want to be able to do this before I implement it completely.
neonrainmusic
 
Posts: 1
Joined: Tue Jun 15, 2010 1:13 am

Re: Hide widget on one particular page

Postby vaakash » Tue Jun 15, 2010 12:52 pm

Add the following code
Code: Select all
if(is_single(array(  POST IDs SEPERATED BY COMMA    ))){
     return false;
 }

above the line
Code: Select all
# Before the widget

If you want to disable in pages use this code
Code: Select all
if(is_page(array(   POST IDs SEPERATED BY COMMA  ))){
     return false;
 }

replace POST IDs SEPERATED BY COMMA by the post's ID to disable
User avatar
vaakash
Site Admin
 
Posts: 672
Joined: Sun Jan 17, 2010 11:15 am
Location: India

Re: Hide widget on one particular page

Postby altarin » Tue Sep 28, 2010 2:19 pm

Hey,

The line "# before the widget" doesn't exist any more or at least I can't find it. Where should the code be placed now? Please help me I really need to get this wonderful plugin to work, except on one page.
altarin
 
Posts: 4
Joined: Tue Sep 28, 2010 2:16 pm

Re: Hide widget on one particular page

Postby vaakash » Wed Sep 29, 2010 12:07 pm

No need to do any editing works ! :)

Since this feature was, it was immediately introduced in the next version.Please use the latest version.
All you have to do is,
1. Get the new version
2. Enter the Post ids where you don't want in the textbox given in the widget
3. Save it.

That's all. As per the request, this feature was immediately taken under consideration in the next version.
The new version was released on 2010-8-9 itself !

Regards,
Aakash Chakravarthy.
User avatar
vaakash
Site Admin
 
Posts: 672
Joined: Sun Jan 17, 2010 11:15 am
Location: India

Re: Hide widget on one particular page

Postby altarin » Wed Sep 29, 2010 2:25 pm

I see, but for some reason it works on every page except my blog page. I've got a page called "blog" on which the posts appear that I write because I have a static front page. That blog page has ID number 134 but whenever I enter that number in the widget it still displays the widget on my blog page. It does work for other pages though but I need it to work on my blog page.
altarin
 
Posts: 4
Joined: Tue Sep 28, 2010 2:16 pm

Re: Hide widget on one particular page

Postby vaakash » Thu Sep 30, 2010 6:07 am

Get the latest version and do the following editing work.

Open html-javascript-adder.php file
Goto line 104
Replace
Code: Select all
if(in_array($post->ID, $splitId)){
with
Code: Select all
if(is_singular($splitId)){

Hope this works !

If this works please alert me as i can implement in the next version.
User avatar
vaakash
Site Admin
 
Posts: 672
Joined: Sun Jan 17, 2010 11:15 am
Location: India

Re: Hide widget on one particular page

Postby altarin » Thu Sep 30, 2010 5:59 pm

Sorry but this doesn't work either. Isn't there a function in wordpress that identifies the blogs main page? This plugin has a feature that always it to disable the plugin on the blogs main page: http://wordpress.org/extend/plugins/adv ... xt-widget/ and I think it uses something like that, but it then also disables the widget on the posts and the archives which is something I don't want. I only want it disabled on the blogs main page. Do you know how you can get it disabled only on the blogs main page like the "advanced text widget" plugin does but then for only the blogs main page?
altarin
 
Posts: 4
Joined: Tue Sep 28, 2010 2:16 pm

Re: Hide widget on one particular page

Postby vaakash » Sun Oct 03, 2010 12:00 pm

I got the answer for the problem !
If you want to disable the widget on the "Blog" page (which lists the post) then just check the "Don't display in Home page" checkbox in the widget.

You don't need to enter the post ID for disabling the widget in the home page (i.e "Blog" page).

Hope it is understood !
User avatar
vaakash
Site Admin
 
Posts: 672
Joined: Sun Jan 17, 2010 11:15 am
Location: India

Re: Hide widget on one particular page

Postby altarin » Sun Oct 03, 2010 12:19 pm

Thanks Aakash, this works! I thought the home page was the page at the toplevel domain, not the blog page. Thanks you for you time.
altarin
 
Posts: 4
Joined: Tue Sep 28, 2010 2:16 pm

Re: Hide widget on one particular page

Postby vaakash » Sun Oct 03, 2010 4:39 pm

I too got the answer after repeated tests. Crushed my mind with an easy answer beside :D
User avatar
vaakash
Site Admin
 
Posts: 672
Joined: Sun Jan 17, 2010 11:15 am
Location: India

Next

 


  • Related topics
    Replies
    Views
    Last post


Return to HTML Javascript Adder


phpBB SEO