ThemeShaper Forums » Thematic

[closed]

Child theme question after updating

(8 posts)
  • Started 4 years ago by quercus
  • Latest reply from quercus
  • This topic is not resolved
  1. I set up my blog with a Thematic Child theme last year, and then stopped blogging. Recently I revived my blog, and of course Wordpress and Thematic were in need of updating. I updated both of them, and my Child theme mostly protected my blog design. However, the updating process did cause one glitch that I don't know how to fix.

    Before updating, I had a nice setup for a horizontal menu of pages right below the header. Each link was in a little box. I have no idea how I made that happen, but I have a vague sense that it had something to do with the functions.php file in my child theme folder. That menu only had two links: One was for my "about" page, and one was for "blog front page", because my custom header is not clickable.

    I plan to add more pages, so in the future there will be more items in that menu.

    Could one of you design-masters explain to me how I can get my nice menu of horizontal boxes back? After updating, the "blog front page" link is entirely gone, and the "about" link is small and needs its style settings changed.

    Blog URL: http://bendingtreearts.com/blog

    Here's my current child-theme functions.php file:

    <?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' );

    function childtheme_content($content) {
    if (is_category()) {
    $content= 'full';}
    return $content;
    }
    add_filter('thematic_content', 'childtheme_content');
    ?>

    thanks for any help!

    Posted 4 years ago #
  2. OK, I've got the "home" link back in my menu. Someone had put a "commented out" bit of code in the Thematic parent functions.php file with just what I needed. I just had to remove the slash signs and paste it into my child theme functions.php file.

    Here it is, for anyone else who's confused by this:

    <?php
    function childtheme_menu_args($args) {
    $args = array(
    'show_home' => 'Home',
    'sort_column' => 'menu_order',
    'menu_class' => 'menu',
    'echo' => true
    );
    return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');
    ?>

    Now I just have to figure out the style of the menu.

    Posted 4 years ago #
  3. OK, I feel like I'm going nuts. I have a basic grasp of how to do things in html and CSS, and I put together an OK website. But the whole blog (except for the stylesheet) is in php. I don't understand how to link php together with the stylesheet that governs it.

    My blog is at http://bendingtreearts.com/blog

    I want to make a HORIZONTAL nav menu just below my blog header, to have a link to my home page, and also links to other pages (like "about").

    Two links currently exist, in default design form, which is plain and VERTICAL. I want the links in boxes, and have them be a certain font and color and so on.

    Here's my entire functions.php file, in my child theme, which is responsible for the "HOME" link on my menu.

    <?php
    function childtheme_menu_args($args) {
    $args = array(
    'show_home' => 'Home',
    'sort_column' => 'menu_order',
    'menu_class' => 'menu',
    'echo' => true
    );
    return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');
    ?>

    My main question is, how do I link my stylesheet up to this php function, so that the menu is styled the way I want? I removed the entire #menu portion of my stylesheet and NOTHING CHANGED. The whole menu is currently styled according to some invisible default setting.

    I feel like there must be a really obvious answer to this question, but I'm just befuddled.

    Please, pretty please, can someone clear this up for me? Thank you.

    Posted 4 years ago #
  4. Hi,

    take a look at the Thematic Classic child theme.

    Chris

    Posted 4 years ago #
  5. it looks like you have superfish menu javascript installed but it is not working. you need to use the sf-menu classes in the default css file,

    Posted 4 years ago #
  6. Chris -- thank you. I downloaded that child theme that you mentioned and compared it to what I already had. It turned out that my child theme style sheet was missing a couple of the import commands: the one about basic image styles, and the one about themes and colors. So I added those into my existing child style sheet and, voila, a horizontal menu.

    Not the exact color and font I want, but definitely progress. I'm more confident now that I can figure out how to adjust the appearance of the menu items.

    jrobben -- thank you also, but I'm too much of a beginner to make sense of your reply. Superfish? Javascript? I looked in the source code and saw something that says sf-menu, so maybe that's what you're talking about. I'll try to change the css to say "sf-menu" instead of plain "menu", but I'm totally out of my depth here.

    In any case, it may not be pretty yet, but at least I have a working horizontal menu now and I don't feel like banging my head on a wall anymore.

    Posted 4 years ago #
  7. It doesn't work anymore.

    My stylesheet no longer connects to my menu, and the menu no longer has the "home" link.
    I temporarily had the "home" link on my horizontal menu.

    And I was temporarily able to achieve some of the styling I wanted (color-tweaking, etc.) by doing what jrobben suggests above, and changing the #menu entries in my css to .sf-menu. But then after a while I kept getting this error message:

    Warning: Cannot modify header information - headers already sent by (output started at /home2/bendingt/public_html/blog/wp-content/themes/thematic_child/functions.php:2) in /home2/bendingt/public_html/blog/wp-includes/pluggable.php on line 865

    and pretty soon my blog page wouldn't even open, even after I restarted my computer.

    So I went in via the server and cleared out the whole functions.php file, and then the error message was fixed.

    Then I put back the functions.php file which Chris recommended, which looks like this:

    <?php

    function childtheme_head_scripts()
    add_filter('thematic_head_scripts','childtheme_head_scripts');

    function childtheme_menu_args($args) {
    $args = array(
    'show_home' => 'Home',
    'sort_column' => 'menu_order',
    'menu_class' => 'menu',
    'echo' => true
    );
    return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');
    ?>

    But there's nothing I can do to get back the "HOME" link on my menu. I tried changing the CSS entries to .menu and then I even tried #menu, which is what they were last year. And then I put them back to .sf-menu. I even tried making them hot pink, so I'd be sure they were working. The menu CSS doesn't connect to anything anymore.

    It shouldn't be this hard, should it? I'm inexperienced, but I'm trying hard to learn and I've been doing nothing but this for 2 and a half days.

    Posted 4 years ago #
  8. Perfect, beautiful solution to the entire problem:

    "Page Links To" plug-in by Mark Jaquith.

    I sent him a donation. If I could, I'd send him a bouquet of roses, lilies, orchids...

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.