|
#1
Nov 17, 2013, 10:29 AM
|
|
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.
|
#2
Nov 17, 2013, 11:27 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
the easiest way would be to put in two CSS statements,
HTML Code:
#idofyourwidgetarea {display: none;}
body.front-page #idofyourwidgetarea {display: block;}
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#3
Nov 18, 2013, 02:31 AM
|
|
Thank you Juggledad,
But the code does not work. May be I did something wrong?
|
#4
Nov 18, 2013, 05:17 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
did you use the actual ID of your widget area or did you use '#idofyourwidgetarea'?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#5
Nov 18, 2013, 06: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?
|
#6
Nov 18, 2013, 06:33 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
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.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#7
Nov 18, 2013, 08: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;}
|
#8
Nov 18, 2013, 01:25 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
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?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#9
Nov 19, 2013, 03: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?
|
#10
Nov 19, 2013, 03:52 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
What is the URL?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#11
Nov 19, 2013, 06:02 AM
|
|
|
#12
Nov 19, 2013, 06:49 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
try this
HTML Code:
#divslider {display: none;}
body.home #divslider {display: block;}
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#13
Nov 19, 2013, 08:46 AM
|
|
Thanks, it works.
Donation was transferred directly to you.
|
|