WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Modifying a Theme - What file sets the #page background ? (5 posts)

  1. FeralReason
    Member
    Posted 4 years ago #

    Just getting started trying to learn how to modify the default theme but I cannot seem to find out how to change the background image for the #page div. In trying to find where this code is, I used firebug and selected this background image (kubrickbg-ltr.jpb). Firebug shows the following css for this #page div:

    #page {
    -moz-background-clip:border;
    -moz-background-inline-policy:continuous;
    -moz-background-origin:padding;
    background:transparent url(http://localhost/blog/wp-content/themes/feralpots/images/kubrickbg-ltr.jpg) repeat-y scroll center top;
    border:medium none;
    }

    Unfortunately Firebug locates this code as being in "blog (line 14)" -- no filename. I've grepped for various portions of this code and cannot find where it is.

    Does anyone know what file I edit to point this background to another image ?

    Thanx, Glenn

  2. Jonathan Dingman
    Member
    Posted 4 years ago #

    Well what you could do is just create another entry,

    #page { background: url(/images/my-new-file-name.jpg) !important; }

    that !important will override what you had before or is set elsewhere. I sometimes do this if I need to.

  3. FeralReason
    Member
    Posted 4 years ago #

    Thanks -- that will probably do it. For that matter, I could rename my own background image so that it has this name...

    However -- I hate mysteries in code that is going to run in production. I would still like to know what code, generated how, creates this line in the #page div: background:transparent url(http://localhost/blog/wp-content/themes/feralpots/images/

    Somebody out there knows ....

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    In the default theme, it's:

    <?php
    // Checks to see whether it needs a sidebar or not
    if ( empty($withcomments) && !is_single() ) {
    ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg-<?php bloginfo('text_direction'); ?>.jpg") repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
    <?php } ?>

    in header.php.

  5. FeralReason
    Member
    Posted 4 years ago #

    Thanks esmi -- that explains why my grep turned up nothing. The filename is being created through concatenation.

    Guess if I want to modify this theme it actually DOES make sense to just change the name of my own image to kubrickbg-ltr.jpg.

    Strange ....

    Thanx again, Glenn

Topic Closed

This topic has been closed to new replies.

About this Topic