The MU forums have moved to WordPress.org

User Definable Banner (18 posts)

  1. kodama
    Member
    Posted 15 years ago #

    I'm looking for a plug-in to allow users to insert their own banner image at the top of their page.

    Instead of allowing a customisable header image (I want to keep continuity throughout the site), i'd rather users be able to upload an image similar to a banner ad at the top of their page, though probably larger.

    Can anyone suggest a plug-in that would fit that use?

  2. kodama
    Member
    Posted 15 years ago #

    Anyone have any ideas for this?

  3. andrea_r
    Moderator
    Posted 15 years ago #

    No, most people use the custom header option. Which I think woudl still work if they've all got the same theme(s) to pick from and can uplaod a header image. There's a few themes out there with it built in already.

  4. dizzy99
    Member
    Posted 15 years ago #

    I'd like to see someway of doing this too. You could widget the theme to allow them to replace the default header with a widgetized version but its hardly one click then and a little daunting for non technicals.

  5. kodama
    Member
    Posted 15 years ago #

    Just a thought (and I have no idea if it will work - my coding is rubbish)...

    If you were to put a query such as "If 'headerimage.jpg' exists in http://www.domain.com/blogs.dir/blognumber/anymonth then display, else display theme as normal", in the page code could this allow users to upload files within their admin panel and as long as it was named correctly it would display?

    Like I said - i'm no good with code, so before I try to figure it out, I thought i'd put it to you cluey lot.

  6. andrea_r
    Moderator
    Posted 15 years ago #

    Before you code it, it's in the latest nightly - a new function to define custom banners for themes.

    See here for details:
    http://boren.nu/archives/2007/01/07/custom-image-header-api/

  7. kodama
    Member
    Posted 15 years ago #

    That looks fantastic. Thanks *again* - you're quickly becoming a serial savoir for my site. ;)

    Just to clarify before I go reinstalling my build - does the latest nightly of WPMU have the custom banners function? The link above appears to be concerned with WP2.1

  8. dizzy99
    Member
    Posted 15 years ago #

    Yes it does and really should meet your needs entirely. It works like a dream too :)

  9. kodama
    Member
    Posted 15 years ago #

    I've got the options working perfectly in the admin, but i'm not really sure how to get it to display on the page.

    Which part of the code from the above page gets it to display?

  10. dizzy99
    Member
    Posted 15 years ago #

    You need to include the CSS from the theme in the header style function in your themes function.php. Best way to understand it is to look at the examples.

    function header_style() {
    ?>
    <style type="text/css">
    #masthead{
    background: url(<?php header_image() ?>) no-repeat;
    }
    <?php if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) ) { ?>
    #blogTitle, #blogTitle a {
    display: none;
    }
    <?php } else { ?>
    #masthead h1#blogTitle, #masthead #blogTitle a, #blogTitle a:hover {
    color: #<?php header_textcolor() ?>;
    }

    <?php } ?>
    </style>
    <?php
    }

    For instance.

    All its doing is overriding your theme style defaults and each themes style is different. So open your themes CSS and copy the styles that show your header image in that function, replacing the image url with <?php header_image() ?> and the colours with <?php header_textcolor() ?>.

  11. drmike
    Member
    Posted 15 years ago #

    We finally got this? *sheeze* Go away for a couple of months.... :)

    I really need to upgrade my installs.

  12. dizzy99
    Member
    Posted 15 years ago #

    Oh its a corker Dr Mike :) UPGRADE :)

  13. drmike
    Member
    Posted 15 years ago #

    If I can get out of teh wordpress forums and my own and email and support tickets and every thing else, I can get to doing the upgrades. :)

    Already skipping helping the 2 churches who feed the homeless on Saturdays. :(

  14. drmike
    Member
    Posted 15 years ago #

    It's choaking for me.

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'header_style' was given in /home/dariabe/public_html/wp-includes/plugin.php on line 123

    I'm assuming that it;s because of the following:

    add_custom_image_header('header_style', 'coffeecup_admin_header_style');

    I'm assuming that since that's the only occasion where 'header_style' is in there all by itself.

  15. drmike
    Member
    Posted 15 years ago #

    Strange. I get the error with the coffeecup theme but not with the benevolence theme. Works fine for me with benevolence.

    *shrug* Go figure.

  16. drmike
    Member
    Posted 15 years ago #

    Anyone else been able to get coffeecup working with a header image?

    I dropped in Cutline and Greenery today from the wp.com svn tat we discussed. I noticed something strange though in the function.php files:

    In Cutline's function.php:
    add_custom_image_header('', 'cutline_admin_header_style');

    in Greenery's function.php:
    add_custom_image_header('header_style', 'greenery-10_admin_header_style');

    Note the different header_style bits in there. Then I get the error with Greenery but not with Cutline. (I only get the error on the Custom header image page so i can live with it for the time being. Coffeecup I got it everywhere) I tried following the example within Cutline and removed the 'header_style' bit but that didn't help.

    Rather annoying... :(

  17. dizzy99
    Member
    Posted 15 years ago #

    I've only tried this on a couple of themes so not sure if or what could be the issue but i've always used the add_custom_image_header('header_style', 'XXXXX_admin_header_style'); where XXXX is my themes function name and it appears to work.

    I never tried coffee cup cos frankly i don't like the theme but it should be the same across all the themes.

    I would imagine you've checked and double checked that your function name matches with your function call ?

    so

    function header_style() {
    My themes header CSS goes here
    }

    function dizzy99_admin_header_style() {
    My theme override stuff goes here
    }

    add_custom_image_header('header_style','dizzy99_admin_header_style');

    I can't see where the errors would generate as its basically a CSS theme override isn't it ?

  18. drmike
    Member
    Posted 15 years ago #

    Yup, double checked the names.

    I noticed a ticket in trac this morning with the same error coming out of the pluggable.php file but for a different function.

    I'm not big on coffee cup either but one of my main bloggers uses the theme so i was hoping to get it out the door first.

    I'm again a couple versions behind. I'll do some upgrading and see what becomes of the issue.

    It's strange it occurs wirth Greenery as that was one of the themes I *cough* borrowed from wp.com.

    That and the Cutline's add function is different and that's the only theme that's worked completely so far.

    Go figure. :)

About this Topic