Biztos pofonegyszerű, és rajtam kívül szerintem mindenki tudja.
A sablonom ilyet csinál minden oldalra:
Kód:
<div id="siteDescription">Ez a "Honlap egysoros leírása ... Néhány szóban
érdemes leírni, hogy miről is szól ez a honlap"</div>
A Wordpress Meta Description plugin előhoz egy "kivonat" mezőt, ahová ha bármit beírok, akkor az lesz a meta desc.
Ez idáig rendben is van, legalábbis remélem. Azért javítsatok ki ha tévedek. (Tehát bejegyzéseknél és oldalaknál is jelen van a fenti kód is, és a meta desc is. Gondolom ez nem baj.)
Így most mindenhol van egyedi desc, kivéve a főoldalon. Oda hogyan varázsoljak egyedi leírást?
Lehet rosszul, mindenesetre feltételezem hogy a Fő mintasablon (index.php)-ba kellen írni egy ilyet: <meta name="description" content="leírás" />
De hová?
Kód:
<?php get_header(); ?>
<div id="coreContent" class="hfeed">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post hentry">
<?php the_date('F j, Y', '<h5 class="postDate"><abbr class="published">','</abbr></h5>'); ?>
<div class="postContent">
<h3 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<!-- <h4 class="vcard author">by <span class="fn"><?php the_author(); ?></span></h4> -->
<div class="entry-content">
<?php the_content('Read the rest of this entry »'); ?>
</div>
</div>
<div class="postMeta">
<?php if ('closed' == $post->comment_status) : ?>
<div class="comments closed">
<?php else : ?>
<div class="comments">
<?php endif; ?>
<?php comments_popup_link('leave a comment', '1 comment', '% comments', '', 'comments closed'); ?>
</div>
</div>
</div>
<?php endwhile; ?>
<div class="pageNav">
<div class="prev"><?php next_posts_link('« Older') ?></div>
<div class="next"><?php previous_posts_link('Newer »') ?></div>
</div>
<?php else : ?>
<?php endif; ?>
</div>
<?php get_footer(); ?>
Előre is köszi! :-)
Könyvjelzők