Hallo,
also vorab: ich bin kein PHP-profi o.ä. also kanns eigtl gar nicht.
ich versuche jetzt schon seit 1 woche, in meinem template den autor auf der startseite anzeigen zu lassen. gemeint ist damit dieses "written by ..." welches in vielen theme's nicht vorhanden ist.
die index.php und die single.php muss ich verändern, dass weiss ich schonmal.
in der single.php hat es auch geklappt.
habe folgenden code eingefügt:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h1><a id="post-<?php the_ID(); ?>" href="<?php the_permalink() ?>" rel="bookmark" title=" <?php the_title(); ?>"><?php the_title(); ?></a></h1>
<h5>By <?php the_author_posts_link() ?> on <?php the_time('F j, Y') ?> | <a href="index.php"><?php the_category(', ') ?></a> <!-- || <a href="index.html">No Comments</a> --></h5>
wenn ich dann direkt auf den post klicke, ist es so, wie ich es haben möchte. hier mal ein screen:
http://i34.tinypic.com/30sk2ab.png
in der index.php klappt es allerdings nicht.
ich kann machen und tun, es verändert sich nichts.
ich änder übrigens die index.php von dem theme, ich hoffe das ist richtig, nicht dass ich die wp index.php ändern muss?
ich weiss natürlich auch nicht, ob ich den code (den gleichen den ich in der single.php eingefügt habe) auch an der richtigen stelle platziert habe.
hier mal meine index.php wie sie im original (ohne verändeurng) aussieht:
<?php
/**
* @package WordPress
* @subpackage Classic_Theme
*/
get_header();
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_date('','<h2>','</h2>'); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_tags(__('Tags: '), ', ', ' — '); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
<div class="storycontent">
<?php the_content(__('(more...)')); ?>
</div>
<div class="feedback">
<?php wp_link_pages(); ?>
<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
</div>
</div>
<?php comments_template(); // Get wp-comments.php template ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<?php posts_nav_link(' — ', __('« Newer Posts'), __('Older Posts »')); ?>
<?php get_footer(); ?>
Alles anzeigen
wo muss ich meinen code einfügen, dass autor usw auch auf der startseite angezeigt werden? :confused: