سؤال

Ok, I'm using the TagCloudShortCode plugin. I have a problem with how my tag pages display.... I want them to display the way they show on my main page, with the image and more button... how do I change the way it displays?

I want it to display like this http://www.top-iphone-apps.info/

but it displays like this http://www.top-iphone-apps.info/?tag=free

(I know very little about coding, so try to be specific, and if you give me code explain what each line does so I can learn please)

thanks!

Update... I fixed it by changing this in the index.php file

<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
            <div class="entry-summary">
                <?php the_excerpt(); ?>
            </div><!-- .entry-summary -->

to

<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
            <div class="entry-content">
                <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
                <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
            </div><!-- .entry-content -->

basically copying the stuff from the else statemnt. It worked, but I know it's a sloppy way of fixing it, so if anyone can tell me the better way of doing it I'd appreciate it.

هل كانت مفيدة؟

المحلول

First, the root of your issue is that WordPress has two very different template tags to output posts: the_content() and the_excerpt(). There are a lot of nuances with these and many get details wrong, I did my best to get everything right in post at my blog if you are interested that Make sense of WordPress excerpts and teasers.

In this specific case you want the_content(), but theme uses the_excerpt().

Simply editing it as in your follow-up in question is not really sloppy, actually it is the only (non-messy) way to change one of these to another.

Problem is you will lose your edits next time you update Twenty Ten (or WordPress, since Twenty Ten is part of package).

The slightly more complex, but solid and upgrade proof way is to create child theme for Twenty Ten and apply your tweaks there.

  1. Create child theme, see Child Themes in Codex. It uses Twenty Ten as example, should be easy to follow.
  2. Switch to your child theme, at start it would be identical to Twenty Ten.
  3. Create file loop-tag.php in your child theme's folder.
  4. Copy content of Twenty Ten loop.php to that loop-tag.php you created.
  5. Apply your edits to loop-tag.php (you can probably just throw out extra stuff if you feel like it, this file will only load for tag archive pages).

نصائح أخرى

open the file "tag.php" in an an editor, replace

get_template_part( 'loop', 'tag' );

with

get_template_part( 'loop', 'index' ); 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى wordpress.stackexchange
scroll top