Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   Trying to insert 'dynamic headers' into horbar2 (http://forum.bytesforall.com/showthread.php?t=1843)

fruitbat May 30, 2009 02:41 AM

Trying to insert 'dynamic headers' into horbar2
 
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

paulae May 30, 2009 10:32 AM

Take a look at http://forum.bytesforall.com/showthr...hlight=horbar1 .

fruitbat Jun 3, 2009 02:20 AM

Thank you:)

eyup Jun 4, 2009 08:04 AM

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 '<'

?

juggledad Jun 4, 2009 09:35 AM

where did you put this code?

eyup Jun 4, 2009 09:57 AM

functions/bfa_header_config.php

(using latest version 3.3.3)

juggledad Jun 4, 2009 10:40 AM

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

eyup Jun 4, 2009 11:50 AM

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.

eyup Jun 4, 2009 01:25 PM

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.

Flynn Jun 5, 2009 03:41 AM

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>'


eyup Jun 5, 2009 10:45 AM

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.

krystyna Jul 22, 2009 06:03 PM

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!!!! :)

eyup Jul 23, 2009 02:58 AM

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.

krystyna Jul 23, 2009 08:11 PM

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.

eyup Jul 24, 2009 04:11 AM

I wonder if it's a case of adding a new widget area into the heading area and forgetting %bar - not sure tho...

juggledad Jul 24, 2009 06:19 AM

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

Friland Oct 5, 2009 06:26 AM

Quote:

Originally Posted by eyup (Post 7895)
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?

Friland Oct 5, 2009 06:46 AM

eyup
thank you. now it works.


All times are GMT -6. The time now is 07:37 PM.

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