ThemeShaper Forums » Thematic

Child and parent template question

(4 posts)
  • Started 15 years ago by quercus
  • Latest reply from Ian Stewart
  • This topic is resolved
  1. I've tried to reason this out, but I can't quite follow the labyrinth of logic.

    Here's my question:

    I created a special little functions.php file and uploaded it into my child theme folder. It is only for the purpose of adding a "home" button on my nav bar -- or menu, if that's the right word.

    It worked beautifully. I was happy.

    Then I changed the stylesheet of my child theme to make those menu buttons a different color. The color change affected ONLY the buttons which were governed by the parent functions.php template. The color change did not affect the "home" button which I had created using the new functions.php template which resides in my child theme folder.

    So how and where do I change the color of my "home" button? And for all future interactions between my new custom functions.php file and my custom stylesheet...

    How do I make them talk to each other?

    I'm sure the answer is simple, but I still don't understand the interactions well enough to figure it out on my own.

    Many thanks.

    Posted 15 years ago #
  2. Can you post the relevant code?

    Posted 15 years ago #
  3. Sure.

    Here's the entirety of the functions.php file which lives in my child theme folder.

    _______________________________________
    <?php
    function sample_menu() {
    $menu = '<div id="menu">

      ';
      if ( is_home() ) {
      $menu .= '<li class="current_page_item"><a href="';
      }
      else {
      $menu .= '
    • <a href="';
      }
      $menu .= get_option('home') . '/" title="Home">Blog front page
    • ';
      $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0') );
      $menu .= "
    </div>\n";
    echo $menu;
    }
    add_filter('sandbox_menu', 'sample_menu' );
    ?>
    ___________________________________

    And here's the little piece of my child theme css where I changed the color:

    #menu a {
    display:block;
    float:left;
    margin:0 10px 0 0;
    padding:1px 6px;
    background:#E8E196;

    The way I created the child theme css was that I just pasted in the entire style sheet from the parent theme, rather than just doing the command where I would override individual bits of the parent theme. The whole-sheet paste-in method seemed less confusing to me, since I'm not familiar with stylesheets and it takes me a long time to figure out/guess which parts refer to what.

    My blog is at bendingtreearts(dot)com(slash)blog.

    thanks!

    Posted 15 years ago #
  4. It looks like it should work. Try being more specific with your CSS, as in:

    #menu li a {
    }
    Posted 15 years ago #

RSS feed for this topic

Reply

You must log in to post.