ThemeShaper Forums » Thematic

[closed]

Rearranging elements within single post

(7 posts)
  • Started 3 years ago by Foomandoonian
  • Latest reply from krowchuk
  • This topic is resolved
  1. I'm trying to figure out how to rearrange the elements of my posts for a Thematic child theme I'm attempting. I'm HTML and CSS literate, but everything else is a bit of a mystery.

    Basically, I want to put the dvi.entry-meta and div.entry-utility bits in a new box and move them to the left of my post.

    I'm sure this is a noobish question, but I'd really appreciate a pointer as it's the only thing holding me up!

    Cheers.

    Posted 3 years ago #
  2. sounds like you need to override the single loop.

    dig into the content-extensions.php file of thematic (hint it is in the library/extensions folder). copy the thematic_single_post() function directly to your child's functions.php file.

    then you might have noticed something in the content-extensions.php ... basically there is a condition that says if the function childtheme_override_single_post exists that thematic will run this preferentially. this is a rather cool feature Gene and Chris implemented semi-recently. so to take advantage you just rename the function you added to your functions.php to childtheme_override_single_post. you can use this override on almost alllll thematic functions... by replacing the 'thematic' part of the function name with 'childtheme_override'. it is pretty brilliant.

    anyway, that gets you

    function childtheme_override_single_post() { 
    
    				thematic_abovepost(); ?>
    
    				<div id="post-<?php the_ID();
    					echo '" ';
    					if (!(THEMATIC_COMPATIBLE_POST_CLASS)) {
    						post_class();
    						echo '>';
    					} else {
    						echo 'class="';
    						thematic_post_class();
    						echo '">';
    					}
         				thematic_postheader(); ?>
    					<div class="entry-content">
    <?php thematic_content(); ?>
    
    						<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'thematic') . '&after=</div>') ?>
    					</div><!-- .entry-content -->
    					<?php thematic_postfooter(); ?>
    				</div><!-- #post -->
    		<?php
    
    			thematic_belowpost();
    	}

    now within this function you can change the markup/ordering to your heart's content.

    it sounds like you will be wanting to take thematic_postfooter and put it in its own div. if you want the postmeta you'll have to override thematic_postheader so that it only shows the title and then probably call the thematic_postheader_postmeta() function in your new div.

    it is all in the content-extensions.php file. look in there and copy the parts you want to change to your functions.php

    Posted 3 years ago #
  3. Hey, thanks Helga!

    It took me a while to get to grips with all that, but I've finally gotten all the bits in all the right places.

    MUCH appreciated. :)

    Posted 3 years ago #
  4. AnotherAndrew
    Member

    WHY DIDN"T I KNOW ABOUT THIS SOONER!!!

    So helpful and easy.

    Posted 3 years ago #
  5. Thanks helgatheviking!!

    Posted 3 years ago #
  6. This should work? Right?
    This should display MMMM at the top of the post and BACON at the bottom of the post?

    // Customizing post markup with childtheme override
    function childtheme_override_single_post() { 
    
    				thematic_abovepost(); ?>
    
    				<div id="post-<?php the_ID();
    					echo '" ';
    					if (!(THEMATIC_COMPATIBLE_POST_CLASS)) {
    						post_class();
    						echo '>';
    					} else {
    						echo 'class="';
    						thematic_post_class();
    						echo '">';
    					}
         				thematic_postheader(); ?>
    					<div class="entry-content">
    
    					<div>MMMMM</div>
    
    <?php thematic_content(); ?>
    
    						<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'thematic') . '&after=</div>') ?>
    
    					<div>BACON</div>
    
    					</div><!-- .entry-content -->
    					<?php thematic_postfooter(); ?>
    				</div><!-- #post -->
    		<?php
    
    			thematic_belowpost();
    
    }

    But the post just shows as normal without my bacon!

    Any ideas?

    Posted 3 years ago #
  7. Sorry for the cross post! After posting here I thought maybe I should start a new thread, and then come back and edit the above! But, I guess there is a time limit on editing, I can't edit the above out... so sorry!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.