Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

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


  #1  
Old Nov 17, 2013, 09:29 AM
Nasti
 
7 posts · Nov 2013
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  
Old Nov 17, 2013, 10:27 AM
juggledad's Avatar
juggledad
 
23,671 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  
Old Nov 18, 2013, 01:31 AM
Nasti
 
7 posts · Nov 2013
Thank you Juggledad,
But the code does not work. May be I did something wrong?
  #4  
Old Nov 18, 2013, 04:17 AM
juggledad's Avatar
juggledad
 
23,671 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  
Old Nov 18, 2013, 05:21 AM
Nasti
 
7 posts · Nov 2013
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  
Old Nov 18, 2013, 05:33 AM
juggledad's Avatar
juggledad
 
23,671 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  
Old Nov 18, 2013, 07:14 AM
Nasti
 
7 posts · Nov 2013
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  
Old Nov 18, 2013, 12:25 PM
juggledad's Avatar
juggledad
 
23,671 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  
Old Nov 19, 2013, 02:17 AM
Nasti
 
7 posts · Nov 2013
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  
Old Nov 19, 2013, 02:52 AM
juggledad's Avatar
juggledad
 
23,671 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  
Old Nov 19, 2013, 05:02 AM
Nasti
 
7 posts · Nov 2013
Thanks, the Url
  #12  
Old Nov 19, 2013, 05:49 AM
juggledad's Avatar
juggledad
 
23,671 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  
Old Nov 19, 2013, 07:46 AM
Nasti
 
7 posts · Nov 2013
Thanks, it works.
Donation was transferred directly to you.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I create a new widget area? guldarmband Montezuma Theme 1 May 24, 2013 02:01 AM
Cannot create widget area on category page sober Sidebars & Widgets 1 Aug 18, 2011 03:44 PM
Unable to create new widget area paulae Sidebars & Widgets 6 Sep 14, 2009 08:32 AM


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


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