Hello everyone, I'm in a bit of trouble - maybe I'm blind but I've been looking for an answer pretty much everywhere and I can't really find it. Though I'm not really a php guy, so that might be the reason. Or I'm just plain stupid. ;)
What I'd like to do is, I want my post to display as following:
title
picture of post, then aligned to the right (or along picture settings set during post creation) in one line: on the left date and comments, on right facebook button, then after break excerpt and in footer read more link (not right after excerpt like in default).
So no header because I want my date to display where post should start on the right to the picture, and moved read more.
What I did is this:
<?php function remove_nav_above() {
remove_action('thematic_navigation_above', 'thematic_nav_above', 2);
}
add_action('init','remove_nav_above');
?>
<?php function childtheme_postheader() {
global $post;
if (is_page()) { ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php } elseif (is_404()) { ?>
<h1 class="entry-title">Oj! Nie odnaleziono! :(</h1>
<?php } elseif (is_single()) { ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-meta">
<span class="entry-date"><abbr class="published" title="<?php get_the_time('Y-d-m:i:sO'); ?>"><?php the_time('j F, Y') ?></abbr></span>
</div><!-- .entry-meta -->
<?php } else { ?>
<h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'thematic'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<?php }
}
add_filter ('thematic_postheader', 'childtheme_postheader');
function childtheme_postfooter() {
global $post;
if (is_single()) { ?>
<div class="entry-utility">
<?php printf(__('<a href="%1$s" title="Permalink do %2$s" rel="bookmark">Permalink</a> do tego postu.', 'thematic'),
get_permalink(),
wp_specialchars(get_the_title(), 'double') ) ?>
<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) : // Comments and trackbacks open ?>
<?php printf(__('<a class="comment-link" href="#respond" title="Dodaj komentarz">Dodaj komentarz</a> lub pozostaw trackback: <a class="trackback-link" href="%s" title="URL Trackback do tego postu" rel="trackback">Trackback URL</a>.', 'thematic'), get_trackback_url()) ?>
<?php elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) : // Only trackbacks open ?>
<?php printf(__('Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'thematic'), get_trackback_url()) ?>
<?php elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) : // Only comments open ?>
<?php printf(__('Trackbacks are closed, but you can <a class="comment-link" href="#respond" title="Post a comment">post a comment</a>.', 'thematic')) ?>
<?php elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) : // Comments and trackbacks closed ?>
<?php _e('Both comments and trackbacks are currently closed.') ?>
<?php endif; ?>
<?php edit_post_link(__('Edit', 'thematic'), "\n\t\t\t\t\t<span class=\"edit-link\">", "</span>"); ?>
</div><!-- .entry-utility -->
<?php } else { ?>
<?php if ( $post->post_type == 'post' ) { // Hide entry utility on searches ?>
<div class="entry-utility">
<span class="meta-nav"><?php get_the_content(__('Leave a comment', 'thematic'), __('1 Comment', 'thematic'), __('% Comments', 'thematic')) ?></span>
</div><!-- .entry-utility -->
<?php } ?>
<?php }
}
add_filter ('thematic_postfooter', 'childtheme_postfooter');
?>
And here's my shot at changing post (but doesn't really work the way I want it to, ie. doesn't show post at all. ;)
<?php
function childtheme_post() {
global $post;
if (is_single()) { ?>
<?php } else { ?>
<?php if ($post->post_type == 'post') { // Hide entry meta on searches ?>
<div class="entry-meta">
<span class="entry-date"><abbr class="published" title="<?php get_the_time('Y-d-m:i:sO'); ?>"><?php the_time('j F, Y') ?></abbr></span>
<span class="meta-sep">|</span>
<span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'thematic'), __('1 Comment', 'thematic'), __('% Comments', 'thematic')) ?></span>
<?php edit_post_link(__('Edit', 'thematic'), "\t\t\t\t\t<span class=\"meta-sep\">| </span>", "</span>\t\t\t\t\t"); ?>
</div><!-- .entry-meta -->
<?php } ?>
<?php }
}
add_filter ('thematic_post2', 'childtheme_post');
?>
Also I've found something like that:
<?php
function remove_index_loop() {
remove_action('thematic_indexloop', 'thematic_index_loop');
}
add_action('init', 'remove_index_loop');
function snippet_index_loop() {
global $post;
/* Count the number of posts so we can insert a widgetized area */ $count = 1;
while ( have_posts() ) : the_post() ?>
<?php $counter++; $clear=''; ?>
<div class="column <?php if ($counter == 1) { echo 'one'; } elseif ($counter == 2) { echo 'two'; } else { echo 'three'; $counter = 0; $clear='<div style="clear:both;height:0px;"></div>';} ?>">
<div class="clear-fix">
<div id="post-<?php the_ID() ?>" class="<?php thematic_post_class() ?>">
<?php thematic_postheader(); ?>
<div class="entry-content">halo
<?php the_excerpt(); ?>halo
<?php the_content(); ?>halo
<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'thematic') . '&after=</div>') ?>
</div>
<?php thematic_postfooter(); ?>
</div><!-- .post -->
</div><!-- .clear-fix -->
</div><!-- .column -->
<?php comments_template();
if ($count==$thm_insert_position) { get_sidebar('index-insert');}
echo $clear;
$count = $count + 1;
endwhile;
}
add_action('thematic_indexloop', 'snippet_index_loop');
?>
but it's not really what I'm looking for because thumbnail isn't there, and read more button vanishes too..
So what I'm asking is: how to put date etc. divs right above post text, and how to move read more?
Thanks for your help!