Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

Trying to insert 'dynamic headers' into horbar2


  #1  
Old May 30, 2009, 03:41 AM
fruitbat
 
2 posts · May 2009
Hello Flynn,

Thank you so much for your theme, it's a lot more powerful than I'd ever imagined and much better than the others I looked at I'm using it as a CMS. Usually use Joomla but that's so heavy!

This is my test site:
http://www.jobigger.co.uk/wordpress/

I'm trying to insert the code from a plugin called 'dynamic headers' (DH) into horbar2 so that I can define the image displayed on each page in the blue horizontal bar without coding it in to individual pages which would make it tricky for my client to manage. I've tested the DH snippet in header.php (and it works) and may well use it there in a table or somehting and deactivate horbar2 if all else fails but I'd rather have it in bfa_header_config.php in horbar2 if that were at all possible.

This is the DN snippet:
<?php show_media_header(); ?>

I do appreciate that I haven't made a contribution yet and the reaosn is that I don't have any money, I'm trying to build up a web design business and my hubbie is out of work.. bla... bla... bla... everybody's like this at the moment! I'm getting paid once this site is finished and can make one then

I've been trying not to ask you anything, search the forums and things but this has gotten me, most probably because I'm not a proper developer - more of a look it up as I go along and hope for the best sort of designer!!

If you can help I'd appreciate it.

Many thanks

Jo
  #2  
Old May 30, 2009, 11:32 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
Take a look at http://forum.bytesforall.com/showthr...hlight=horbar1 .
  #3  
Old Jun 3, 2009, 03:20 AM
fruitbat
 
2 posts · May 2009
Thank you
  #4  
Old Jun 4, 2009, 09:04 AM
eyup
 
34 posts · Mar 2009
Did you manage to get Dynamic Headers working?

I tried adding in: functions/bfa_header_config.php

Code:
if (strpos($header_items,'%bar1')!==false) {
	// Horizontal bar 1
	$horizontal_bar1 = '<div class="horbar1">' . <?php show_media_header(); ?> . '</div>';
	// END of Horizontal bar 1
But get:

Parse error: syntax error, unexpected '<'

?

Last edited by eyup; Jun 4, 2009 at 10:56 AM.
  #5  
Old Jun 4, 2009, 10:35 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
where did you put this code?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Jun 4, 2009, 10:57 AM
eyup
 
34 posts · Mar 2009
functions/bfa_header_config.php

(using latest version 3.3.3)
  #7  
Old Jun 4, 2009, 11:40 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
try
$horizontal_bar1 = '<div class="horbar1">' . '<?php show_media_header(); ?>' . '</div>';
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #8  
Old Jun 4, 2009, 12:50 PM
eyup
 
34 posts · Mar 2009
Hi and thanks for the response.

Your suggestion gets rid of the error message. Though the actual plugin isn't working. I'm using Wordpress 2.8-beta2.

Hmm it would be interesting to hear if anyone has got it going yet.
  #9  
Old Jun 4, 2009, 02:25 PM
eyup
 
34 posts · Mar 2009
Well the plugin does work in WP 2.8 and the Thematic theme - just by doing:

Code:
<?php thematic_aboveheader(); ?>   

    <div id="header">
        <?php thematic_header() ?>
<?php show_media_header(); ?>
    </div><!-- #header-->
    
<?php thematic_belowheader(); ?>   

    <div id="main">
in the header.php file.

Maybe because i'm editing the bar1 area? All I'm looking to do is add it below all the header area.

Last edited by eyup; Jun 4, 2009 at 02:36 PM.
  #10  
Old Jun 5, 2009, 04:41 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
PHP is already open, you shouldn't put another opening PHP tag here

$horizontal_bar1 = '<div class="horbar1">' . <?php show_media_header(); ?> . '</div>';

Also, if show_media_header(); prints something then you cannot do

$variable = show_media_header();

but need to capture the output first

PHP Code:
ob_start(); show_media_header(); 
$show_media_header ob_get_contents(); ob_end_clean();
$horizontal_bar1 '<div class="horbar1">' $show_media_header '</div>'
Otherwise, if show_media_header() doesn't print anything:

PHP Code:
$horizontal_bar1 '<div class="horbar1">' show_media_header() . '</div>'
  #11  
Old Jun 5, 2009, 11:45 AM
eyup
 
34 posts · Mar 2009
Page specific Flash or images in header solution!

Wey hey! It's working.

Thanks go to Flynn! (and some dosh when I get some ;-)

Here's a walk through.

Install the Dynamic Headers plugin. This also involves creating a new folder called 'header-images' in your 'wp-content' folder and chmod it to 777.

In themes/atahualpa333/functions/bfa_header_config.php

Change...

Code:
	// Horizontal bar 1
	$horizontal_bar1 = '<div class="horbar1">&nbsp;</div>';
	// END of Horizontal bar 1
To...

Code:
	// Horizontal bar 1
	ob_start(); show_media_header(); 
$show_media_header = ob_get_contents(); ob_end_clean();
$horizontal_bar1 = '<div class="horbar1">' . $show_media_header . '</div>';
	// END of Horizontal bar 1
Upload your header images or swf files using the plugin and you can choose which appears on which page using the new menu when you edit a page.

You can also change where they appear (above or below logo/menu etc) in the Atahaulpa Header options page by changing the position of %bar1.

Only one thing I've found is that the menu for selecting which image/swf goes on the page doesn't remember what you selected - so next time you update the page it goes back to the default image unless you change it.
  #12  
Old Jul 22, 2009, 07:03 PM
krystyna
 
121 posts · Apr 2009
I got it to work on this site (and am elated beyond words!!!):

http://modernconcretesurfaces.net

BUT as you can see the existing header spills over the container.

How can I set %bar1 to "top-center" like the %image?

Otherwise I'll just resize the images or make the width fixed, but it would be nice to know if this can be done anyway.

My last atahualpa hurdle has been crossed. Yeehaw!!!!
  #13  
Old Jul 23, 2009, 03:58 AM
eyup
 
34 posts · Mar 2009
I think it's going to be quicker to resize the Flash to the correct width - it will be a smaller file size too.

But have you checked out the new version of Atahaulpa - 3.4.2 ?

Now instead of messing with the php files you can insert Dynamic Headers by simply pasting <?php show_media_header(); ?> in the option pages, simply go to:

Style & edit HEADER AREA > Configure Header Area

Here's an example:

%logo %image %pages %bar1 <?php show_media_header(); ?> %bar2

Also with WP 2.8 it now remembers which header for which page - unlike before when it reset to the default. Wey hey.
  #14  
Old Jul 23, 2009, 09:11 PM
krystyna
 
121 posts · Apr 2009
I actually did do that with the new version of Atahualpa and it worked fine. Now I need to figure out how to make %bar2 into an image.
  #15  
Old Jul 24, 2009, 05:11 AM
eyup
 
34 posts · Mar 2009
I wonder if it's a case of adding a new widget area into the heading area and forgetting %bar - not sure tho...
  #16  
Old Jul 24, 2009, 07:19 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
krystyna
you can make your image just fill the screen area by changing the three places where it says width="1498" to width="1oo%" - the problem is that it resizes the width to fit AND resizes the height, so it becomes very short. Since this is a fixed width site. I would recrop the base image to the size you need
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #17  
Old Oct 5, 2009, 07:26 AM
Friland
 
17 posts · Aug 2009
Quote:
Originally Posted by eyup
Wey hey! It's working.

Thanks go to Flynn! (and some dosh when I get some ;-)

Here's a walk through.

Install the Dynamic Headers plugin. This also involves creating a new folder called 'header-images' in your 'wp-content' folder and chmod it to 777.

In themes/atahualpa333/functions/bfa_header_config.php

Change...

Code:
	// Horizontal bar 1
	$horizontal_bar1 = '<div class="horbar1">&nbsp;</div>';
	// END of Horizontal bar 1
To...

Code:
	// Horizontal bar 1
	ob_start(); show_media_header(); 
$show_media_header = ob_get_contents(); ob_end_clean();
$horizontal_bar1 = '<div class="horbar1">' . $show_media_header . '</div>';
	// END of Horizontal bar 1
Upload your header images or swf files using the plugin and you can choose which appears on which page using the new menu when you edit a page.

You can also change where they appear (above or below logo/menu etc) in the Atahaulpa Header options page by changing the position of %bar1.

Only one thing I've found is that the menu for selecting which image/swf goes on the page doesn't remember what you selected - so next time you update the page it goes back to the default image unless you change it.
That's great, thanks. Thanks for giving us a walk through. I have Atahualpa 3.4.1 and there the bfa header config looks different... Do you know how the coding would look for this version?
  #18  
Old Oct 5, 2009, 07:46 AM
Friland
 
17 posts · Aug 2009
eyup
thank you. now it works.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cache and rotating images headers! Ponics Header configuration & styling 8 Dec 31, 2010 03:30 AM
Warning: Cannot modify header information - headers already sent by ... bruno-d-horse New Versions, & Updating 5 Mar 31, 2010 03:29 AM
Set different headers for each page curious Header configuration & styling 17 Jun 19, 2009 05:53 PM
Sticky Headers + Sidebar justjoolz Atahualpa 3 Wordpress theme 1 Apr 7, 2009 06:57 AM
Page Menu button images w/dynamic resize kritho Page & Category Menu Bars 1 Feb 18, 2009 06:06 PM


All times are GMT -6. The time now is 12:53 AM.


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