The MU forums have moved to WordPress.org

wpmu mit subblogs? different header images? (33 posts)

  1. sepp88
    Member
    Posted 14 years ago #

    hi there,

    i set up wpmu with a few subblogs. all the blogs use the same theme. the theme has a header-image right on the top of the page. i want that to be different for every blog.

    how can i do that? any ideas?

    thank you and regards

  2. mercime
    Member
    Posted 14 years ago #

  3. sepp88
    Member
    Posted 14 years ago #

    thank you, will try that today evening.
    one more question...i've installed the "MU Sitewide Tags Pages" plugin, so that all posts of all blogs are showing up on my main-blog. i still could't get it to work, that they are showing up on my mainblog, however i could on a seperate generated blog called "tags". this blog collects all posts of all blogs.

    is there a way, so that i can for instance give every subblog kind of an icon of symbol, so that everybody knows of which subblog the post comes from.

    for instance. if i have a subblog about football, one about tennis and one about ski, and all posts of these subblogs are showing up on my main-blog, i want every single post to have an icon or symbol attached that indicates which blog it's coming from.

    is that possible?

  4. mercime
    Member
    Posted 14 years ago #

    Haven't done that but it's possible. Check out the forum re sitewide tags pages - http://mu.wordpress.org/forums/tags/sitewide-tags

  5. andrea_r
    Moderator
    Posted 14 years ago #

    "i still could't get it to work, that they are showing up on my mainblog, however i could on a seperate generated blog called "tags"."

    Under Site Admin -> Options, there's a checkbox to tell it to use the main blog.

  6. sepp88
    Member
    Posted 14 years ago #

    Under Site Admin -> Options, there's a checkbox to tell it to use the main blog.

    i know, i've seen that, and the OPTION IS CHECKED.
    but it doesn't work, maybe my theme-template is different. i'll try today evening with another theme. don't know what i'm doing wrong!

    @mercime thank you: will try that today evening as well.

  7. andrea_r
    Moderator
    Posted 14 years ago #

    Theme doesn't matter.

    I do know it works though.

  8. sepp88
    Member
    Posted 14 years ago #

    well, it won't work for me:
    privacy settings of my subblog! here

    options in my site-admin on my mainblog: here

    i have two posts on my subblog and one on my mainblog. if i look on my mainblog i can see only one post, exactly the one of my mainblog.

    if i let the plugin itself create a blog called tags, all posts show up there, but they simply won't show up on my mainblog! don't get it. maybe i'll try a complete new install on my localhost!

  9. andrea_r
    Moderator
    Posted 14 years ago #

    And if you go on the sub-blog and do a new post, it won't show up on the main blog for you?

  10. sepp88
    Member
    Posted 14 years ago #

    @mercime I once more need your help please! i simply don't get it:
    i have a functions.php file in my themes folder. it's written that i should post the following code right above the last ?> tag! however i don't get it,

    //make changeable header
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', 'setta.jpg'); // %s is theme dir uri and image filename
    define('HEADER_IMAGE_WIDTH', 985);  // make sure these values match the theme header
    define('HEADER_IMAGE_HEIGHT', 200);
    define( 'NO_HEADER_TEXT', true );
    
    function atypxmas_admin_header_style() {   // change atypxmas to your theme name
    ?>//CLOSE PHP TAG
    
    // this part adds the header in the admin area
    #headimg {
    height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    }
    
    #headimg h1, #headimg #desc {
    display: none;}
    }
    
    function header_style() {
    ?>//CLOSE PHP TAG AGAIN
    
    #header{
    background: url(<?php header_image() ?>) no-repeat;}
    }
    
    add_custom_image_header(’header_style’, ‘atypxmas_admin_header_style’);  // change atypxmas to your theme name you used above.

    i simply don't get the code. they say i just need to copy and paste the code right into my functions.php file. but the code is very irresolute fr me. they have a close php tag ?> twice, even if they never open it with <?php ???

    of course that way, the code is completely wrong. i even get the wrong code-hinting in my coding-software.

    so my current functions.php contains...

    <?php
    	if ( function_exists('register_sidebars') )
    	register_sidebars(1);
    
    ?>

    where do i post the sample code of the wpmu tutorial post???

  11. sepp88
    Member
    Posted 14 years ago #

    and @andrea_r i managed to get the sitewide-post plugin to work! thank you for your support!

    i now only need two more things.
    first i want every blog to have this custom header image. and second i want every post on my mainblog to indicate where it's coming from. either through a symbol or through different colors or something.

  12. andrea_r
    Moderator
    Posted 14 years ago #

    For the header:

    - it does say you need to edit the file
    - don't scrape the text from the post, you'll get wrong code, a txt file is provided.

    To edit the file, change these lines

    define('HEADER_IMAGE', 'setta.jpg'); // %s is theme dir uri and image filename
    define('HEADER_IMAGE_WIDTH', 985); // make sure these values match the theme header

    Your header will not be called 'setta.jpg'. You need to change it.

  13. sepp88
    Member
    Posted 14 years ago #

    oh thank you, i don't get why i haven't noticed that link! weird! maybe i was just too overworked yesterday evening. will implement that today evening right away.

  14. sepp88
    Member
    Posted 14 years ago #

    i tried that now, and can't get it to work:
    my theme is called "modicus-remix" and when i go into my DESIGN-panel in my admin WP tells me that the theme directory is: /themes/modicus-remix/modicus-remix

    <?php
    	if ( function_exists('register_sidebars') )
    	register_sidebars(1);
    ?>
    
    <?php
    
    //make changeable header
    
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '/themes/modicus-remix/modicus-remix/images/headers/header.png'); // %s is theme dir uri
    define('HEADER_IMAGE_WIDTH', 900);
    define('HEADER_IMAGE_HEIGHT', 188);
    define( 'NO_HEADER_TEXT', true );
    
    function modicus-remix_admin_header_style() {
    ?>
    <style type="text/css">
    #headimg {
    	height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    	width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    }
    
    #headimg h1, #headimg #desc {
    	display: none;
    }
    
    </style>
    <?php
    }
    
    function header_style() {
    ?>
    <style type="text/css">
    #header{
    	background: url(<?php header_image() ?>) no-repeat;
    }
    </style>
    <?php
    }
    
    add_custom_image_header('header_style', 'modicus-remix_admin_header_style');
    
    ?>

    is this even working with a two-word theme name?
    anyway, the real theme name isn't "modicus-remix", just the directory is called "modicus-remix"! WP tells me the actual theme name is called:
    image

  15. andrea_r
    Moderator
    Posted 14 years ago #

    This is what that line shoudl be:

    define('HEADER_IMAGE', 'images/headers/header.png'); // %s is theme dir uri

    It's relative to where the functions.php file is.

  16. sepp88
    Member
    Posted 14 years ago #

    thank you! somehow this is not working properly.

    <?php
    	if ( function_exists('register_sidebars') )
    	register_sidebars(1);
    ?>
    
    <?php
    
    //make changeable header
    
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', 'images/headers/header.png'); // %s is theme dir uri
    define('HEADER_IMAGE_WIDTH', 900);
    define('HEADER_IMAGE_HEIGHT', 188);
    define( 'NO_HEADER_TEXT', true );
    
    function modicus-remix_admin_header_style() {
    ?>
    <style type="text/css">
    #headimg {
    	height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    	width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    }
    
    #headimg h1, #headimg #desc {
    	display: none;
    }
    
    </style>
    <?php
    }
    
    function header_style() {
    ?>
    <style type="text/css">
    #header{
    	background: url(<?php header_image() ?>) no-repeat;
    }
    </style>
    <?php
    }
    
    add_custom_image_header('header_style', 'modicus-remix_admin_header_style');
    
    ?>

    i changed all values i have to change. "theme dir url", "constraints of my header image", "themename"

    if i sace this functions.php file, the whole page get WHITE. nothing on there anymore.

  17. sepp88
    Member
    Posted 14 years ago #

    no idea what i'm doing wrong? i don't get it, if i save the file (functions.php) my whole blog turns white. but i can't find any mistakes in the code (every line gets closed with an ;)

  18. mercime
    Member
    Posted 14 years ago #

    Hi sep88, don't know why the code is not working for you. Are you hosted on Windows server? As an aside, not that I'm suggesting that you give up on the method above, here is a thread about custom header images using another method (lower down the thread - starting with RAULOR post) for WPMU install using one theme that you might also be interested in.

  19. andrea_r
    Moderator
    Posted 14 years ago #

    If you look in your error logs, it should tell you where the error is. :)

    I would start by changing this:

    function modicus-remix_admin_header_style
    to

    function modicus_remix_admin_header_style

    (and the one at the end to match)

    It does not have to match the folder name.

  20. sepp88
    Member
    Posted 14 years ago #

    thank you, it's now working perfectly.

    didn't know that i can rename the theme!

  21. sepp88
    Member
    Posted 14 years ago #

    oh, one really last question to the SITE-WIDE-TAGS plugin. i've now everything running with all my subblog. so my mainblog collects all posts from the all subblog. really cool. however, all posts which are coming from subblogs have automatically disabled comments! so they are not really disabled if i click on the post, i'll jump to the actual subblog itself and there i can comment on it. however on my mainblog the little section in the lower right corner which says "no comments" or "comments disabled" is always set to "comments disabled", although they are not really disabled!

    how can i change that. is that possible?

  22. andrea_r
    Moderator
    Posted 14 years ago #

    "didn't know that i can rename the theme! "

    you're not, you're just naming a function.

  23. sepp88
    Member
    Posted 14 years ago #

    yeah, of course! since i'm not much of a coder i don't find the right words to describe the problems i'm having. anyway, thanks andrea_r for your really great support so far.

    maybe you know why my mainblog says that the comments of the subblog-posts are disabled, even if they aren't! ???

  24. sepp88
    Member
    Posted 14 years ago #

  25. TracyKeleher
    Member
    Posted 13 years ago #

    I can't seem to get this to work ... does this work with the "default" theme? After changing all of the required elements, I don't see the option to upload any header images for each blog?

  26. TracyKeleher
    Member
    Posted 13 years ago #

    Ok - I got the uploader in the backend working, but it is still not showing on the blog. The address is http://www.innovatia.net/blogs/training_blog.

    Edit: for those of you using the default theme, you would change the theme name to "kubrick", not "default" as I was trying ... :)

  27. TracyKeleher
    Member
    Posted 13 years ago #

    Hi everyone - just an update that I did get this to work. The design company that set this up for us replaced many of the code specifics in the header.php and index.php file which took out the required functions for this to work - thanks!

  28. eltioska
    Member
    Posted 13 years ago #

    Hi everyone,

    I'm trying to do this using the free Arthemia theme.
    I got the backend working, but once I upload the image, nothing happens.

    One difference: I'm not trying to change the "main" header. There's a space on the top right - just next to the header image - which was designated as a space for adverts. I want to put a different image for each site in this place.

    I noticed that this code (as on Andrea's wpmututorials site) affects this part of the code: ´<?php wp_head(); ?>´

    Is it possible to edit the css to anchor the change to a part of the html in "header.php"?

    More specifically:

    the header.php has this section:
    ´<div id="head" class="clearfloat">´

    and it has 2 subsections:

    ´<div id="logo" class="left">´
    and
    ´<div class="right">´

    and it's the element (an image) in the ´<div class="right">´ that I want to have changed for each site.

    Is it possible?

    cheers

  29. andrea_r
    Moderator
    Posted 13 years ago #

    The header code needs to be told what div you're putting the new header in. If it's a div called "right" make sure you reference that.

  30. eltioska
    Member
    Posted 13 years ago #

    Cheers, that's what I figured. So I tried editing the header.php, by moving the ´<?php wp_head(); ?>´ below the ´</head>´ and under the div i want it to go, but it didn't work. Then I read that the ´<?php wp_head(); ?>´ shouldn't be put out of the ´<head> </head>´ div.

    So I'm a bit lost as to whether I should edit the additional code in functions.php or the header.php ... or both!

    Is it in the functions.php where I should reference the image to the div called "right"?

About this Topic