• Resolved hilj

    (@hilj)


    This page explains the more tag, Im trying to ad it when writing a new Page but nothing happens.

    Should I somehow modify the code on index.php file to make this work? Maybe ad the the_excerpt() somewhere?

    Heres part of the index.pht

    <div id="content" class="narrowcolumn">
    
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post">
    				<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    
    				<div class="entry">
    					<?php the_content('Read the rest of this entry &raquo;'); ?>
    				</div>
    
    				<p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <!--<?php edit_post_link('Edit','','<strong>|</strong>'); ?>-->  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    				<hr />
    				<!--
    				<?php trackback_rdf(); ?>
    				-->
    			</div>
Viewing 12 replies - 1 through 12 (of 12 total)
  • when writing a new Page

    If you meant a Page – the more doesn’t work on Pages.

    Thread Starter hilj

    (@hilj)

    Yeah, Page it is. Is there some other way to do this?

    This would be only for the front page.

    I am confused. You are talking about your index.php but Pages are rarely displayed by that template file.
    See Template_Hierarchy.

    And as a general rule: instead of asking something about a code detail… it is always better if you tell what your final goal is and then we might be able to tell you the “how-to”.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Using the more tag doesn’t make any sense for Pages. Pages are not Posts, they don’t get displayed other than when you’re looking at the Page itself.

    See, a Post has its own Post page (single.php is its template) as well as being displayed elsewhere, usually with other Posts. The more tag is used to link to that Post page from other places where the Post can be displayed.

    Pages, however, don’t do that. The only time you see Page content is when you’re looking at that Page. You don’t have any other way to see it, it only has one location.

    So it sounds like you think the more tag does something different than it actually does.

    Thread Starter hilj

    (@hilj)

    Of course, sorry about that.

    The goal: I’m using WP as CMS. I’ve defined one Page as front page of the site. I would like to display the latest happening on the front page. Cause the description of the happening is so long and may contain lot of images, I would like to display only a beginning of it, say, first ~10 lines or so (it varies so I would need to able to control it easily).

    The Problem: more does not work for pages. How’s it possible to do this?

    Sorry again and thank you!

    Edit: otto42 thanks for the clarification.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    hilj: I get that, but I think you’re not fully understanding here.

    You’ve defined a Page as the front page. So, if you were to cut it off and then have a more link, where would that more link go? Pages only have one URL, one location. Since you’ve defined it as the main page, the more link, logically, would go back to the page you’re already looking at: The front page.

    More doesn’t make sense for Pages because you don’t display Page content in more than one place. So the problem is not “more doesn’t work for pages”, the problem is that you’re trying to use a Page in a way that it’s not really designed for.

    It seems to me that instead of using a Page to hold your happenings content, you should use Posts, perhaps in a specific category called “Happenings”. Then you use a plugin or something to only show the latest 1 post from the happenings category on the front page. No need to have a “static” front page then, especially one that’s not really static. Also, the more tag will work, because it’s Posts, and not a Page.

    the_excerpt should work on a Page designed as homepage – at least it does in this test.

    Thread Starter hilj

    (@hilj)

    Otto42, you said it!

    But now it raises other kind of questions.

    1. How can I chance the text of the “Read the rest of this entry”?

    2. Now it shows, in this case, useless info like:
    -the gategory where it was posted.
    -the comment status (of in this case)
    -the date posted
    Can I get rid of these?

    Thank you!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Edit your Theme’s index.php file to make the posts on the front page appear the way you want them to. That’s how you change the display of the front page when it’s posts and not a static page.

    Make a backup copy of it first though, just in case.

    Thread Starter hilj

    (@hilj)

    Oh and when I click the “read more” it throws me to the sing post page, and things appearing there I can edit from single.php. Nice, thanks!

    There most definitely is a reason to use the more tag on certain pages, particularly those pages you want to use WP_Query on to call in posts. Sometimes you want a Page to show posts, but not have it be your default blog posts page.

    You can sometimes use <?php $more=0; ?> to get the more tags to work on these types of Pages, however I’ve run into situations where it just doesn’t work, and I can’t figure out the difference between the two situations.

    Hello. I’m having a similar situation than clicknathan describes.
    I’m using WP as a CMS. Usually, I use category templates archives to display content but I dislike the url it generates.

    Supose I have a main menu that have this buttons:

    Portfolio | Approach | News.

    In the portfolio page, I want to display all posts in portfolio category, but I don’t want that url looks like this: siteurl/category/portfolio.
    I want that url looks like this: siteurl/portfolio (if another method is avalaible to do that I don′t know it).
    So, I create a Page and I assign a Page template file to this.
    This template file is coded using query.
    Before the loop I put:
    <?php query_posts('category_name=portfolio'); ?>
    In this way, I get only all post from portfolio category. But I usually combine different looks for posts in a same page. In my case, I want that posts posted in feauted-portfolio category be in first place and the rest below it. I want that featured post display content whith more tag and the others with the_excerpt.

    But…you say it. More tag doesn’t work with Pages. (I didn′t know it). Although that, is there a way to get it working?. Or, is possible to get short urls instead of /category/ betweeb siteurl and category name?

    Thanks in advance.

    ps: sorry for too long post an my bad english.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘more tag not functioning’ is closed to new replies.