I would like to show full posts on homepage

Viewing 7 posts - 1 through 7 (of 7 total)
  • #1760
    olivier
    Participant

    Hello Daniel, as you will see, I modified a lot the look of your cover wp theme as I used it to migrate from a full html site to a wordpress site. My problem is, for the time being, that I would like to show the full post on the homepage and not the summary. I am a newbie in php and tried different possibilities in order to modify your code but… pointless, I failed. Could you help me ?

    The second point is that I would like that the sticky post (with a welcome message) to stay on the top of the homepage title, not below it. That is important to me, as I will soon develop the website in french and english thanks to qtranslate plugin.

    Anyway, thank you for your great job, hoping you will help me solve the “summary post” problem.

    #1761
    Daniel Tara
    Keymaster

    Hi,

    Wow! I’m really impressed you took the theme and did that out of it πŸ™‚

    Showing the full post instead of the summary should be easy, open the file home.php and replace any occurences of

    [code]<p><?php for($i = 0; $i <= $count – 1; $i++) { echo $excerpt[$i]; echo ‘ ‘; } echo ‘…’; ?> <a” href=”<?php the_permalink() ?>”><?php _e(‘Read entire article’,’cover-wp’) ?> »</a”></p>[/code]

    with [code]<?php the_content(_e(”Read entire article’,’cover-wp”).’ Β»’); ?>[/code]

    Add the same modifications also in index.php.

    As for the sticky post, that’s a bit more complicated:

    Enter the following code in the exact location where you would like to display the sticky post:

    <?php $sticky = get_option('sticky_posts'); $args = array('post__in' => $sticky); ?>
            <?php query_posts($args); ?>
            <?php if((have_posts()) && (!empty($sticky))) : ?>
            <div id="sticky">
              <h3><?php _e('Announcements','cover-wp') ?></h3>
            <?php while(have_posts()) : the_post(); ?>
                <h2><a" rel="bookmark" title="<?php _e('Permanent Link to','cover-wp') ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a"></h2>
                <p class="postmeta" style="margin-bottom:2px;"><?php the_time(__('F jS, Y','cover-wp')); ?> | <?php comments_popup_link(__('Add a Comment','cover-wp'), __('1 Comment','cover-wp'), __('% Comments','cover-wp')); ?></p>
                <div class="the_content">
                  <?php the_content(_e(''Read entire article','cover-wp'').' Β»'); ?>
                </div><!-- /the_content -->
            <?php endwhile; ?>
            </div><!-- /sticky -->
            <?php endif; ?>
            <?php wp_reset_query(); ?>

    Then before the original loop (line [code]<?php if(have_posts()) : while(have_posts()) : the_post(); ?>[/code]) add the following line, to deny the sticky post from being listed there:

    [code]?php query_posts(“caller_get_posts=1&showposts=1”); $i = 1; ?>[/code]

    Make sure you do these modifications only in the blog style view, as I see that’s the one you’re using.

    Good luck!

    #1762
    olivier
    Participant

    Well, thank you Daniel. I like to work at the design and I chose your theme because it is great built and has a lot of features πŸ™‚

    As you will see, I followed your advices but I have still 2 problems :

    1. The homepage is shown with full posts, that is fine, but we can see the mention “Read the entire article” (in romanian) with a dead link and it is now pointless. How can I remove this from all the posts the homepage ? Sorry for the question, I do not want to waste your time but after many tries I couldn’t fix it… But I learn every day managing a park, trust me ! πŸ™‚

    2. I would like to remove the date and comments from the sticky post on the top, as it it useless and will remain there as a “welcome message” for our visitors. How to do it ?

    Thank you again Daniel,

    Olivier

    #1763
    Daniel Tara
    Keymaster

    Hi,

    Try using the code blow. This should not display any date, comment count or broken read more link:

    <?php $sticky = get_option('sticky_posts'); $args = array('post__in' => $sticky); ?>
            <?php query_posts($args); ?>
            <?php if((have_posts()) && (!empty($sticky))) : ?>
            <?php while(have_posts()) : the_post(); ?>
                <h2><a" rel="bookmark" title="<?php _e('Permanent Link to','cover-wp') ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a"></h2>
                <div class="the_content">
                  <?php the_content(_e(''Read entire article','cover-wp'').' Β»'); ?>
                </div><!-- /the_content -->
            <?php endwhile; endif; ?>
            <?php wp_reset_query(); ?>

    By the way, see you at your park one weekend? πŸ˜‰

    #1764
    olivier
    Participant

    Hello again Daniel,

    I tried your solution but it did not work well on the website.

    So I decided to simply use the common feature of sticky post on WordPress and applied this simple php code described : [url=http://wordpress.org/support/topic/removing-date-fom-single-post-welcome-message-1]here[/url], and put it in the loop div in home.php.

    It worked fine to remove on the sticky post the date, comments and category.

    But I still have this dead link with “Read full article” at the beginning of each post that is annoying… I keep on digging and will write back if I find something useful!

    OK, you are welcome in our park if you come in Bucharest ! But for now we will close the facility for the winter period, as it is cold down here in Romania…

    Cheers !

    Olivier

    #1765
    olivier
    Participant

    I just fixed the dead link problem : in home.php, within the loop, I simply replaced the following expression :

    <?php the_content(_e(‘Read entire article’,’cover-wp’).’ Β»’); ?>

    by

    <?php the_content(); ?>

    and it vanished !

    Thank you again for your time, Daniel

    Olivier

    #1766
    hotbiee
    Participant

    olivier said:
    I just fixed the dead link problem : in home.php, within the loop, I simply replaced the following expression :

    <?php the_content(_e(‘Read entire article’,’cover-wp’).’ Β»’); ?>

    by

    <?php the_content(); ?>

    and it vanished !

    Thank you again for your time, Daniel

    Olivier

    Hi,

    I have replaced all files with this code and it work properly to all excepted function.php

    when I replaced it and try on my home page in Popular section has error

    It shows the posts title correctly but the content are the same post.

    I also attached the picture
    [img]http://www.iposto.com/wp-content/uploads/2011/09/popular.png[/img]

Viewing 7 posts - 1 through 7 (of 7 total)

Tagged: ,

You must be logged in to reply to this topic.