|
#1
Jan 24, 2009, 04:21 AM
|
|
Great Theme ! - donation sent
How do I place content into the %bar1 thing
I'd particularly like to place the Blog Tagline in there. Or I could just hide the Blog Tagline and place some text into %bar1 but I don't know how to put it there. I'm quite happy hacking into the index.php if that's what it takes
|
#2
Jan 24, 2009, 05:31 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
Thank you for the donation.
You would have to edit functions/bfa_header_config.php, line 181 or line 187
PHP Code:
$horizontal_bar1 = '<div class="horbar1"> </div>';
Replace
with your (HTML) content.
To put PHP code into a horizontal bar, use
PHP Code:
$horizontal_bar1 = '<div class="horbar1">' . PHP_CODE_HERE . '</div>';
The PHP code should not print output. (i.e. with "echo ...")
Finally add %bar1 or %bar2 at Theme Options -> Header -> Configure Header Area
|
#3
Mar 15, 2009, 01:35 PM
|
|
|
|
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
|
|
I've been able to put a Javascript ad banner inside the bar1 area.
Code:
{// Horizontal bar 1
$horizontal_bar1 = '<div class="horbar1"><center><script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=1&js=Y"></script></center>
</div>';
// END of Horizontal bar 1
}
However, on a few other pages, I want to have a different banner, because those pages or categories are sponsored by different advertisers. How would I do that? I have special templates for those, but they get the same header info. I wonder if I could use some kind of "if is page(?)" code?
Here is the index page: http://larchmontgazette.com/wp27/. Here is the obituaries page where I need a different banner. You can see where I put it down in the body, but I would rather have it up where the other banner is. http://larchmontgazette.com/wp27/?page_id=858
|
#4
Mar 17, 2009, 05:16 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
You could use something like this:
PHP Code:
{// Horizontal bar 1 $horizontal_bar1 = '<div class="horbar1"><center>'; if ( is_page('XX') ) { $horizontal_bar1 .= ' <script language="javascript" src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=1&js=Y"></script>'; } elseif ( is_page('XX') ) { $horizontal_bar1 .= 'OTHER CODE HERE...'; } elseif ( is_category('XX') ) { $horizontal_bar1 .= 'OTHER CODE 2 HERE...'; } else { $horizontal_bar1 .= 'DEFAULT CODE HERE...'; } $horizontal_bar1 .= '</center></div>'; // END of Horizontal bar 1 }
|
#5
Mar 17, 2009, 05:24 PM
|
|
|
|
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
|
|
Thank you. I finally got it working today, in the logo bar, using code to modify bfa_header_config.php you gave somebody else:
Code:
// END of title/description
$logo_area .='
<td rowspan="2" valign="middle" class="header-banner">
BANNER 1 CODE
</td>
<td rowspan="2" valign="middle" class="header-banner">
BANNER 2 CODE
</td>
<td rowspan="2" valign="middle" class="header-banner">
BANNER 3 CODE
</td>
';
http://www.larchmontgazette.com/wp27/
Could I use the "else if" code you mention here in order to make a different banner appear on category pages that are sponsored exclusively by one company?
Last edited by paulae; Mar 17, 2009 at 05:51 PM.
|
#6
Mar 18, 2009, 11:39 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
Sure, you'd use is_category(), is_category('9'), is_category('category-name') or is_category('Category Name') then
|
#7
Mar 18, 2009, 12:21 PM
|
|
|
|
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
|
|
Oh, Flynn, you assume I know more PHP than I do! Could you give me the full code for this? I tried it and my page disappeared. I think I had ' or ; in the wrong places, but I can't seem to figure it out.
I had this:
Code:
// END of title/description
$logo_area .='
<td rowspan="2" valign="middle" class="header-banner">
<img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/hypatialight.jpg" align=left>
</td>
<td rowspan="2" valign="middle" class="header-banner">
<script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=1&js=Y"></script>
</td>
<td rowspan="2" valign="middle" class="header-banner">
<img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/wintergazebo.jpg" width=221 height=80>
</td>
;
if ( is_page('858') ) {
<td rowspan="2" valign="middle" class="header-banner">
<img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/hypatialight.jpg" align=left>
</td>
<td rowspan="2" valign="middle" class="header-banner">
<script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=28&js=Y"></script>
<td rowspan="2" valign="middle" class="header-banner">
<img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/wintergazebo.jpg" width=221 height=80>
</td>;
} elseif ( is_category('63') ) {
<td rowspan="2" valign="middle" class="header-banner">
<img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/hypatialight.jpg" align=left>
</td>
<td rowspan="2" valign="middle" class="header-banner">
<script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=228&js=Y"></script>
<td rowspan="2" valign="middle" class="header-banner">
<img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/wintergazebo.jpg" width=221 height=80>
</td>';
The first part, before the first "if" is working fine.
|
#8
Mar 18, 2009, 02:26 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
You'd need to add some PHP code to either display something or do something with the page specific HTML code. In bfa_header_config.php all HTML code is being collected inside of variables (which represent various area of the header, i.e. $logo_area):
PHP Code:
if ( is_page('858') ) {
$logo_area .= ' .... HTML code for page #858 here ... ';
} elseif ( is_category('12') ) {
$logo_area .= ' .... HTML code for category #12 here ... ';
} elseif ( is_category('63') ) {
$logo_area .= ' .... HTML code for category # 63 here ... ';
} else {
$logo_area .= ' .... default HTML code here ... ';
}
The dot in $logo_area .= means " add the following to the variable $logo_area" (which holds all HTML for the logo area)
The last else { ... } in the code above will be used if none of the conditions above match. So you'd put the default HTML code there.
|
#9
Mar 24, 2009, 04:08 PM
|
|
Hello!
I am brand new to WP and rather self-taught/functionally illiterate in web coding! But thanks to this thread I was able to put iframe code for a digital clock in the right side of the logo area/header space! Now I am trying to get the clock to align vertically to the right of my logo.
Here is my page:
http://www.grainanalyst.com/live-grain-commentary/
And here is the snippet of code I came up with for the bfa_header_config.php:
$logo_area .= get_bloginfo('template_directory') . '/images/' . $bfa_ata_logo . '" alt="' . get_bloginfo('name');
}
$logo_area .= '" /><iframe src="http://free.timeanddate.com/clock/i1gxxi9j/n64/fn2/fs24/ahr/tt0/tw1/tm1/td1/th2/tb2" frameborder="0" width="418" height="35" align="right"></iframe>
</a></td>';
This page is in draft status. I am urging my boss to donate for this great template as this will be a commercial site. THANKS!!!
|
#10
Mar 25, 2009, 01:35 PM
|
|
Made some adjustments I'm happy with. No worries, thanks!
Dagny in Chicago
|
#11
Nov 27, 2009, 10:14 AM
|
|
Quote:
Originally Posted by Flynn
Thank you for the donation.
You would have to edit functions/bfa_header_config.php, line 181 or line 187
PHP Code:
$horizontal_bar1 = '<div class="horbar1"> </div>';
Replace
with your (HTML) content.
To put PHP code into a horizontal bar, use
PHP Code:
$horizontal_bar1 = '<div class="horbar1">' . PHP_CODE_HERE . '</div>';
The PHP code should not print output. (i.e. with "echo ...")
Finally add %bar1 or %bar2 at Theme Options -> Header -> Configure Header Area
|
Hi Flynn,
I love this theme and I have been learning very quickly how to do things from the excellent support you have on here.
I have run into a few problem however and would be happy to donote if these can be resolved.
1. I have added this code ob_start(); wp_loginout(); $loginlink = ob_get_contents(); ob_end_clean();
$page_menu_bar .= '<li>' . $loginlink . '</li>' . "\n";
...so my login is in my Page Menu Bar but I would love it to go in the Horizontal Menu Bar above it where I already have some HTML links inserted. I would also like a register link their too. Can this be done?
2. I would love to leave the Page Menu Bar background white but have the tabs static and hover colours different like blue? I cannot see where this can be modified.
3. Is it possible to put rounded or curved tabs on the page manu bar?
I have provided an image HERE with 1, 2 & 3 referenced in it for convenience and would appreciate any help you can offer?
Many thanks in advance.
SoarH
|
#12
Apr 7, 2012, 02:22 PM
|
|
Can I do this a similar way in order to display the tagline in bar1 one instead of besides the logo?
|
#13
Apr 7, 2012, 02:34 PM
|
|
|
|
10,176 posts · Jul 2009
Central New York State USA
|
|
In place of bar one just use a div with the text you want in it. Below would give you the text in an area with a red background. Just use this in place of %bar1.
HTML Code:
<div style="background:red;"> This is the tagline</div>
__________________
~Larry ( CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
|
#14
Apr 7, 2012, 03:07 PM
|
|
Used
HTML Code:
<div style="background:#003471;font-size: 15px;font-weight: normal;line-height: 18px; color: #B5C0CD;"> <font face="Verdana, Arial, Helvetica, sans-serif">Multimedia,
Musik & mehr für Freiburg und das Dreiländereck</font></div>
which works - but I need to align the text more away from the left border, so that it matches the menu items.
Take a look newlayout.tribe-online.de thanks!
|
#15
Apr 7, 2012, 10:10 PM
|
|
|
|
10,176 posts · Jul 2009
Central New York State USA
|
|
Not exactly sure how you want it to look but you can just use CSS to position wherever you like.
__________________
~Larry ( CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
|
|