WordPress.org

Ready to get started?Download WordPress

Forums

Show Summary NOT Entire Article (26 posts)

  1. James300
    Member
    Posted 7 years ago #

    I have searched out this topic and found what I thought was the answer...however it doesn't seem to work for me.

    I read I was to replace

    <?php the_content(); ?>

    with

    <?php the_excerpt(); ?>

    When I make the switch...I notice no difference on the index page (am editing index.php)...

    Any idea why this does not work?...I'm using a custom theme, but I don't think that would be the cause...

  2. moshu
    Member
    Posted 7 years ago #

    Are you sure you are editing the index.php file of the active theme?

  3. James300
    Member
    Posted 7 years ago #

    Yep :)

  4. moshu
    Member
    Posted 7 years ago #

    Seeing cache?
    It is difficult to guess without a lnk...

  5. James300
    Member
    Posted 7 years ago #

    For sure... here it is: http://www.theinvestingjournal.com

  6. moshu
    Member
    Posted 7 years ago #

    Hmm. Doesn't that theme have its own control panel where you can set what to show: full text or exceprt?

  7. James300
    Member
    Posted 7 years ago #

    Yeah I've tried that option...

    Under: Options > Reading

    There is a 'for each article, show'
    - Full text
    - Summary

    I've tried both..neither one changes anything...

  8. moshu
    Member
    Posted 7 years ago #

    No. That's WordPress options.
    I am thinking about going to Presentation and see if the theme has its own control/options/setting panel. (other themes of the same author have!)

  9. James300
    Member
    Posted 7 years ago #

    Ah I see what you mean.

    No, just checked those options and there's nothing in there for that.

  10. James300
    Member
    Posted 7 years ago #

    Any ideas?...

  11. moshu
    Member
    Posted 7 years ago #

    Aha. Read more carefully the tool you are using (=theme)
    Quote (from the theme's control panel):
    "Choose the layout for the home.php, the home page. The default layout looks the same as the regular index."

    Not index, home.php!

  12. James300
    Member
    Posted 7 years ago #

    ahhhh...geez I even read that :P

  13. James300
    Member
    Posted 7 years ago #

    Sheesh..ok I made the change in home.php... still no difference :(

  14. moshu
    Member
    Posted 7 years ago #

    I'd contact the author. It seems to me as a bug - something is always overriding the settings.

  15. scottwallick
    Member
    Posted 7 years ago #

    James had a question with my blog.txt theme, which we've resolved. It wasn't a bug with the theme, but rather a complication caused by the multiple layout option for the home.php file.

    Basically in the blog.txt home.php file, there are two layouts that are chosen ala conditional based on an option from the Presentation > blog.txt Theme Options menu.

    James had changed the the_content(); for the custom layout, but he was using the default layout so he needed to a change a different, separate the_content();, which I helped him do. One he changed that one to the_excerpt(); he got his desired effect: excerpts on the home page.

    Magic!

    scott

  16. moshu
    Member
    Posted 7 years ago #

    Thanks Scott for posting back the solution. However, may I ask you to be a bit more concrete? Like line# where one should change the_content to the_excerpt when using the default or the custom layout?

    Thank you.

  17. scottwallick
    Member
    Posted 7 years ago #

    Sure, Moshu.

    The following are for the blog.txt theme, version 1.2, in the home.php file.

    Lines 5 through 48 are for the "custom" layout.

    The "custom" layout basically displays one page by its slug (entered in the blog.txt Theme Options menu) and then the most recent post after that.

    The the_content lines for the "custom" layout are on lines 12 and 24.

    Lines 50 through 89 are for the "default" layout.

    The "default" layout is a regular layout, displaying however many posts are set in the Options > Reading menu.

    To change the the_content to the_excerpt in the default layout, you should look at line 58 in the home.php file.

  18. jalongoria
    Member
    Posted 7 years ago #

    I've implemented the changes suggested in the documentation and this posting, but the issue I run into is that even though it creates a 120 word excerpt, it unfortunately does not setup a link to view the full article, though it posts the [...] at the end. Any ideas on what is causing this behaviour?

  19. jalongoria
    Member
    Posted 7 years ago #

    Regarding the post above, I'm using the Gespaa v2 theme and edited code in the index.php.

  20. moshu
    Member
    Posted 7 years ago #

    You shouldn't implement anything from the postings above - since they refer to a particular theme!

    Your title is the (perma)link to your full article.

  21. jalongoria
    Member
    Posted 7 years ago #

    I understand that it should function that way, but it doesn't. That was the first thing I checked when I realized that there was no link inplace in the content matter itself to see "more". I selected the title, but it didn't send me off to the full article.

    So in short, if I hadn't replaced the_content() with the_excerpt(), the entire article shows up on the main page. the_excerpt() effectively cut it down to a small 'summary', but it is now impossible to view the entire article.

    My assumption was that something that was considered a template tag ( http://codex.wordpress.org/Template_Tags/the_excerpt ) would be universal throughout any installation, perhaps I am mistaken in this.

  22. moshu
    Member
    Posted 7 years ago #

    Nothing is "universal" - what is in the code of your theme is entirely up to the theme author, including the title being a permalink. See how it is done in other themes and edit your template files.

  23. jalongoria
    Member
    Posted 7 years ago #

    Been combing through others, to no avail. It seems that there is some "blanket" code that is overriding this change, I've not figured it out as of yet and are going through the code line by line to see if I can figure out what is causing this behaviour.

    If anyone else has used the Gespaa V2 theme and run into this problem/found a solution, I would appreciate your input.

  24. jalongoria
    Member
    Posted 7 years ago #

    I've figured this out. There was a conflicting tag of <?php echo get_permalink() ?> that was overriding the tag I added in single.php.

    For anyone else that encounters this, ensure you have a single.php file(it can mimic your index.php if you don't want to go through the trouble of writing your own) and ensure no template taglines are doubling over themselves.

  25. 2712812
    Member
    Posted 7 years ago #

    I have a default template installed at onedayers.com and am not able to get teh excerpts come (all articles show in full)

  26. 2712812
    Member
    Posted 7 years ago #

    well solved it myself, thanks

Topic Closed

This topic has been closed to new replies.

About this Topic