Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • I have the same problem.. Did you finally find a solution?

    Thanks!

    Well.. You can’t have all at the same time! 🙂

    By using a separate file in your child theme, you ensure that
    1) you don’t overwrite the current parent theme
    2) you don’t overwrite your child theme / changes when updating the parent theme
    3) you can easily remove your child file if it seems incompatible with the updated parent child
    4) you can then take your time to rebuild your child file, mixing your changes with the new parent file…

    But yes, it will still require some work…

    Salut!

    Sorry for the misunderstanding. A quick google search seems to indicate that you can just copy the header.php in your child theme folder, and modify it. It would then be taken into account automatically.

    This is what I understand when reading this:

    Copy header.php to your Child Theme folder and edit it there. In WP 2.6 you’ll need to use WordPreciousss for WP to see it but 2.7 will recognize it automatically.

    I have never done it… but I’ll be interested to hear the result of your testing… 🙂

    Here two examples of what I have done with a child theme for the Thematic Framework theme. The code below has been appended to the function.php file of the child theme.

    The first one: it customizes the “post header meta information” (“Published by: … Date:…”):

    function my_postheader_postmeta(){
    	$postmeta = '<div class="entry-meta">';
    	// $postmeta .= thematic_postmeta_authorlink();
    	// $postmeta .= '<span class="meta-sep meta-sep-entry-date"> | </span>';
    	$postmeta .= thematic_postmeta_entrydate();
    	$postmeta .= thematic_postmeta_editlink();
    	$postmeta .= "</div><!-- .entry-meta -->\n";
    	return $postmeta;
    }
    add_filter('thematic_postheader_postmeta','my_postheader_postmeta');

    The seconde one customizes the footer of the whole website (sorry, in French):

    function my_footer($thm_footertext) {
    	$thm_footertext = 'Propulsé par
            <a href="http://www.ww.wp.xz.cn">WordPress</a>.
            Construit avec le
            <a href="http://www.themeshaper.com/thematic">
            Thematic Theme framework</a> et mon propre thème dérivé:
            <a href="http://www.antanarive.com/blog/prodigal-son/">
            Prodigal Son</a>.';
            return $thm_footertext;
    }
    add_filter('thematic_footertext', 'my_footer');

    How does it work? In both examples, you have to find the name of the function that you want to “override”. You write your own version of it (removing or adding instructions), then you add a “add_filter” instruction to inform WordPress to take into account your function instead of the original one.

    If you want to add some HTML code, you’ll just have to find the original PHP function that is generating the HTML for that area where you want to insert your additional code.

    Most real functions are not in the single.php, header.php, etc but in the content-extension.php, and others. A full text search on the files may help. You can also find some tutorials by googling CHILD THEME FUNCTION FILTER HOOK.. etc.. These kind of keywords.

    Good luck!

    As I am slowly building a child theme, I post all the changes I make here:
    http://www.antanarive.com/blog/prodigal-son/.

    Using my own child theme for Thematic Framework theme, I simply used the following function to override the default footer generation:

    function my_footer($thm_footertext) {
    	$thm_footertext = 'Powered by
            <a href="http://www.ww.wp.xz.cn">WordPress</a>.
            Built with
            <a href="http://www.themeshaper.com/thematic">
            Thematic Theme framework</a> and my own child theme:
            <a href="http://www.antanarive.com/blog/prodigal-son/">
            Prodigal Son</a>.';
            return $thm_footertext;
    }
    add_filter('thematic_footertext', 'my_footer');

    You’ll need to edit the theme, which means those changes will be lost if/when you update. Not a big deal if you keep track of what you have modified.

    The call to display the “un-collapsed” comments is used in the single.php file of your template, since the comments are generally expanded when a post is seen on a single page. What you need to do is copy this call to a function and paste it somwhere in the main loop.

    In my theme, based on Thematic Framework, the call for generating and displaying all comments is:

    // calling the comments template
                thematic_comments_template();

    I assume the function you need is simply comments_template().

    Now, where to paste it? Well, I don’t know. 🙂

    I tried to find the location. I am pretty sure it is somwhere in content-extension.php, in my theme.. but I could not find more.

    PLEASE make a back-up of everything before trying some stunts… 🙂

    This is your HTML:

    <ul id="nav-cat" class="clearfloat">
    <li class="cat-item cat-item-3"><a href="http://updatehawaii.com/?cat=3" title="View all posts filed under Events">Events</a>
    </li>
    <li class="cat-item cat-item-15"><a href="http://updatehawaii.com/?cat=15" title="View all posts filed under Financial">Financial</a>
    </li>

    This is very strange HTML, as each li item has a class name containing what looks like an ID. Does not seem right at all.

    Anyway, in that case, you’ll just need to try and adjust the CSS the left and/or right padding for the relevant li items like this:

    #nav-cat li {
           padding-left: 0;
           padding-right: 0;
    }

    Replace 0 with the value you want, and this will apply only to <li> item inside the item of the class “cat-item”: the <ul>.

    You mean for example the “events”, “financial”, … in the top navigation area? (second link)

    Aranath,

    You will have to look for the precise function that is building the line containing that text, as the bottom of posts.

    I am personnaly using the Thematic Framwork theme, that I am customizing. The default function to generate the post footer is in the file content-extension.php and is the following:

    // Create post category
    function thematic_postfooter_postcategory() {
    
        $postcategory = '<span class="cat-links">';
        if (is_single()) {
            $postcategory .= __('This entry was posted in ', 'thematic') . get_the_category_list(', ');
            $postcategory .= '</span>';
        } elseif ( is_category() && $cats_meow = thematic_cats_meow(', ') ) { /* Returns categories other than the one queried */
            $postcategory .= __('Also posted in ', 'thematic') . $cats_meow;
            $postcategory .= '</span> <span class="meta-sep meta-sep-tag-links">|</span>';
        } else {
            $postcategory .= __('Posted in ', 'thematic') . get_the_category_list(', ');
            $postcategory .= '</span> <span class="meta-sep meta-sep-tag-links">|</span>';
        }
        return apply_filters('thematic_postfooter_postcategory',$postcategory); 
    
    } // end thematic_postfooter_postcategory

    As you see, it contains the words “Posted in”, which could be replaced by your preferred words. That means you would edit the theme directly
    (In my case, I did something esle, since I am not directly editing the theme, but creating a child theme).

    It is not so complicated if you know how to add some lines in the CSS of your theme.

    From the code you pasted above, it seems that the recent posts list is a sub-unordered list with id equal to recent-entries. Therefore, what you want to modify in CSS is the space between <li> elements that are within a <li id="recent-entries"> element.

    Adding space between li elements can be done by specifying some increased bottom margin.

    So, in total, we would have something like:

    #recent-entries li {
    	margin-bottom: 1em;
    }

    Add this to your CSS file. This will only adjust the list of recent posts. I can’t believe mayself it is so simple! 🙂

    It is not so complicated if you know how to add some lines in the CSS of your theme.

    From the code you pasted above, it seems that the recent posts list is a sub-unordered list with id equal to recent-entries. Therefore, what you want to modify in CSS is the space between <li> elements that are within a <li id="recent-entries"> element.

    Adding space between li elements can be done by specifying some increased bottom margin.

    So, in total, we would have something like:

    #recent-entries li {
    	margin-bottom: 1em;
    }

    You indeed have to insert in your HTML templates, the appropriate code to make WordPress insert the dynamic content at the right place.

    Here are a few good tutorials:

    http://themeshaper.com/creating-wordpress-theme-html-structure-tutorial
    http://www.webdesignerwall.com/tutorials/building-custom-wordpress-theme
    http://jonathanwold.com/tutorials/wordpress_theme/

    I am using the Thematic Framework Theme, and I am slowly creating a child theme for it. In my child theme, I have removed the “Published by…”, the author’s name and the vertical separator, by adding my custome function to the function.php file of the child theme. No modification of CSS for that one.

    function my_postheader_postmeta(){
    	$postmeta = '<div class="entry-meta">';
    	// $postmeta .= thematic_postmeta_authorlink();
    	// $postmeta .= '<span class="meta-sep meta-sep-entry-date"> | </span>';
    	$postmeta .= thematic_postmeta_entrydate();
    	$postmeta .= thematic_postmeta_editlink();
    	$postmeta .= "</div><!-- .entry-meta -->\n";
    	return $postmeta;
    }
    add_filter('thematic_postheader_postmeta','my_postheader_postmeta');

    The custom function above is a copy paste of the original function with just two lines commented out, as you can see.

Viewing 14 replies - 1 through 14 (of 14 total)