Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   [SOLVED] Create a new Widget in Header Area only in Homepage (http://forum.bytesforall.com/showthread.php?t=21149)

Nasti Nov 17, 2013 09:29 AM

[SOLVED] Create a new Widget in Header Area only in Homepage
 
Hello,

I'm new here,I would be happy your help.
I want to create a new Widget in Header Area, how can I do it will be available only on the homepage?
Here is my code:

<?php bfa_widget_area('name= slider&cells=2&align=1&align_2=8&align_3=8&width_2 =733&before_widget=<div id="%1$s" class="slider-widget %2$s">&after_widget=</div>'); ?>

Thank you.

juggledad Nov 17, 2013 10:27 AM

the easiest way would be to put in two CSS statements,
HTML Code:

#idofyourwidgetarea {display: none;}
body.front-page #idofyourwidgetarea {display: block;}


Nasti Nov 18, 2013 01:31 AM

Thank you Juggledad,
But the code does not work. May be I did something wrong?

juggledad Nov 18, 2013 04:17 AM

did you use the actual ID of your widget area or did you use '#idofyourwidgetarea'?

Nasti Nov 18, 2013 05:21 AM

I wrote it this way:
# slider {display: none;}
body.front-page # slider {display: block;}

It does not work and it's probably incorrect, right?

What does "id widget" mean? Where can I find it?

juggledad Nov 18, 2013 05:33 AM

It looks to me like you are unfamiliar with CSS. I would suggest you take a CSS tutorial like this one so you have a basic idea of the syntax and how to use it if you want to make changes like this, to the theme.

Nasti Nov 18, 2013 07:14 AM

I know a little CSS, I read the Tutorial. Thanks
I changed the code, but now the widget not found at all. I need it to appear only on the home page.
What did I do incorrect again? :(

#divslider {display: none;}
body.front-page #divslider {display: block;}

juggledad Nov 18, 2013 12:25 PM

if you code #divsLider' that means you have an HTML element that has an ID of 'divslider' assigned to it.

Is 'divslider' the name of the ID?

Nasti Nov 19, 2013 02:17 AM

I think so, here is my code:

<div id="divslider"><div><table id="tableslider">
<?php bfa_widget_area('name= slider&cells=2&align=1&align_2=8&align_3=8&width_2 =733&before_widget=<div id="%1$s" class="slider-widget %2$s">&after_widget=</div>'); ?>

The code works, just not true. He dismisses the widget in all pages, and I need the widget stay in home page.
So what is wrong with it?

juggledad Nov 19, 2013 02:52 AM

What is the URL?

Nasti Nov 19, 2013 05:02 AM

Thanks, the Url

juggledad Nov 19, 2013 05:49 AM

try this
HTML Code:

#divslider {display: none;}
body.home #divslider {display: block;}


Nasti Nov 19, 2013 07:46 AM

Thanks, it works. :)
Donation was transferred directly to you.


All times are GMT -6. The time now is 10:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.