WordPress.org

Ready to get started?Download WordPress

Forums

please help with backgrounds (13 posts)

  1. wonderlandbaby
    Member
    Posted 4 years ago #

    I've been trying to change themes/backgrounds per page. I've followed suggestions from here but have had no luck.....someone please help me :-P been wracking my brain :)

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    A link to your site might help...

  3. wonderlandbaby
    Member
    Posted 4 years ago #

    this is my site http://wonderlandbaby.co.cc/
    and i think i have everything except an absolute file path for the themes? i really have no idea what i'm doing :)

    <?php get_header(); ?>

    <div class="post">

    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>

    <?php if (is_page('down-the-rabbit-hole-to-wonderland') ):
    // page 1 ?>
    <style type="text/css">
    body {background-color:#000;background-image:url(images/body-bg.jpg);background-repeat:repeat;}
    </style>

    <?php elseif (is_page('how to-change-the-world') ):
    // page 2?>
    <style type="text/css">
    body {background-color:#377b8;background-image:url(images/body-bg.jpg);background-repeat:repeat;}
    </style>

    <?php elseif (is_page('gizmos-and-gadgets') ):
    // page 3?>
    <style type="text/css">
    body {background-color:#000;background-image:url(images/img01.jp);background-repeat:repeat;}
    </style>

    <?php elseif (is_page('scribble-scrabble') ):
    // page 4?>
    <style type="text/css">
    body {background-color:#000;background-image:url('images/header.jpg');background-repeat:repeat;}
    </style>

    <?php elseif (is_page('growing-up-radish') ):
    // page 5?>
    <style type="text/css">
    body {http://wonderlandbaby.co.cc/wp-admin/theme-editor/themes/cloud-story-10/img/theclouds.jpg}
    </style>

    <div class="content">

    <h2>" title=??<?php the_title(); ?>??><?php the_title(); ?></h2>

    <?php the_content(); ?>

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    Try moving all of your is_page() conditionals and their attached style declarations to the <head></head> section of header.php.

  5. wonderlandbaby
    Member
    Posted 4 years ago #

    what line should i start it after?

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    Doesn't matter as long as it's before </head> and after the call to your theme's stylesheet.

  7. wonderlandbaby
    Member
    Posted 4 years ago #

    here's what my header.php looks like now

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">

    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style_ie6.css" />
    <![endif]-->

    <!--[if lt IE 7]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style_ie6.css" />
    <![endif]-->

    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php //comments_popup_script(); // off by default ?>

    <?php wp_head(); ?>

    </head>

    <body>

    <div id="header">
    <div id="lid">

    <h1><?php bloginfo('name'); ?></h1>

    <div id="menu">

  8. ">Home
  9. <?php wp_list_pages('title_li=&depth=1' ); ?></div>

  • wonderlandbaby
    Member
    Posted 4 years ago #

    tried this and got blank.... thank you SO SO SO much for helping me

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">

    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style_ie6.css" />
    <![endif]-->

    <!--[if lt IE 7]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style_ie6.css" />
    <![endif]-->

    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php //comments_popup_script(); // off by default ?>

    <?php wp_head(); ?>

    <?php if (is_page('down-the-rabbit-hole-to-wonderland') ):
    // page 1 ?>
    <style type="text/css">
    body {background-color:#000;background-image:url(images/body-bg.jpg);background-repeat:repeat;}
    </style>

    <?php elseif (is_page('how to-change-the-world') ):
    // page 2?>
    <style type="text/css">
    body {background-color:#377b8;background-image:url(images/body-bg.jpg);background-repeat:repeat;}
    </style>

    <?php elseif (is_page('gizmos-and-gadgets') ):
    // page 3?>
    <style type="text/css">
    body {background-color:#000;background-image:url(images/img01.jp);background-repeat:repeat;}
    </style>

    <?php elseif (is_page('scribble-scrabble') ):
    // page 4?>
    <style type="text/css">
    body {background-color:#000;background-image:url('images/header.jpg');background-repeat:repeat;}
    </style>

    <?php elseif (is_page('growing-up-radish') ):
    // page 5?>
    <style type="text/css">
    body {background-color:#000;background-image:url(img/topgradient.png);background-repeat:repeat;}
    </style>

    </head>

    <body>

    <div id="header">
    <div id="lid">

    <h1><?php bloginfo('name'); ?></h1>

    <div id="menu">

  • ">Home
  • <?php wp_list_pages('title_li=&depth=1' ); ?></div>

  • wonderlandbaby
    Member
    Posted 4 years ago #

    still nothing...

  • wonderlandbaby
    Member
    Posted 4 years ago #

    i'm so confused lol anyone shed some light on my problem?

  • alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    @wonderlandbaby
    i think you are nearly there.
    you had ommitted the 'endif' after all the 'elseif's; and a few typing mistakes.

    this is the corrected code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    
    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
    
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style_ie6.css" />
    <![endif]-->
    
    <!--[if lt IE 7]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style_ie6.css" />
    <![endif]-->
    
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php //comments_popup_script(); // off by default ?>
    
    <?php wp_head(); ?>
    
    <?php if (is_page('down-the-rabbit-hole-to-wonderland') ):
    // page 1 ?>
    <style type="text/css">
    body {background-color:#000;background-image:url(<?php bloginfo('template_url'); ?>/images/body-bg.jpg);background-repeat:repeat;}
    </style>
    
    <?php elseif (is_page('how-to-change-the-world') ):
    // page 2?>
    <style type="text/css">
    body {background-color:#377b8;background-image:url(<?php bloginfo('template_url'); ?>/images/body-bg.jpg);background-repeat:repeat;}
    </style>
    
    <?php elseif (is_page('gizmos-and-gadgets') ):
    // page 3?>
    <style type="text/css">
    body {background-color:#000;background-image:url(<?php bloginfo('template_url'); ?>/images/img01.jp);background-repeat:repeat;}
    </style> 
    
    <?php elseif (is_page('scribble-scrabble') ):
    // page 4?>
    <style type="text/css">
    body {background-color:#000;background-image:url(<?php bloginfo('template_url'); ?>/images/header.jpg);background-repeat:repeat;}
    </style> 
    
    <?php elseif (is_page('growing-up-radish') ):
    // page 5?>
    <style type="text/css">
    body {background-color:#000;background-image:url(<?php bloginfo('template_url'); ?>/images/topgradient.png);background-repeat:repeat;}
    </style>
    <?php endif; ?>
    
    </head>
    
    <body>
    
    <div id="header">
    <div id="lid">
    
    <h1><?php bloginfo('name'); ?></h1>
    
    <div id="menu">

    also, please use the 'code' button on top of this edit field, next time you enter code.
    hopefully, all your images are in the right spot.
    good luck ;-)

  • wonderlandbaby
    Member
    Posted 4 years ago #

    okay stupid question but the template url and images/whatever/jpg to find these...

    edit themes
    select theme to edit
    and then do i use them uri? or hmm something like http://wonderlandbaby.co.cc/wp-themes/themes/themename etc.?

    and then for the second part bakground url? like img/theclouds.jpg from the same page?

  • wonderlandbaby
    Member
    Posted 4 years ago #

    would it help if i posted one of the theme style sheets so you could show me where to pull the information to plug in?

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags