Allow headline to retain formatting — show whole post?

Viewing 15 posts - 1 through 15 (of 20 total)
  • #1792
    Gamebynight
    Participant

    Hello,

    I’m currently designing a fansite found [url=http://www.gamebynight.com]here[/url]. I love the theme, it looks and works wonderfully, so thank you very much for all the time you’ve put in. The only thing I would like to change is how the post excerpts are displayed. Ideally, I would like the headlines box to show the full post and cut off when I use the “insert more tag” in the WP post editor. I tried to follow the details on showing full posts at [url=http://www.onedesigns.com/support/topic.php?id=229]this thread[/url], but replacing the code as specified caused there to be syntax errors and the page wouldn’t load beyond that error message. Note that I’d only need to do this to the headline section, since the other sections are fine with excerpts in their current format style.

    If it’s no longer possible to alter the code to display the full post, is there a way to allow excerpts in the headline box to retain their original formatting? Right now, it gets as much text in the box as possible. I would much rather have it keep the formatting if displaying the full post isn’t possible.

    Also, is there a way to limit the amount of “featured” and “popular” articles propagate? We’ll only have a few things going up a week, so ideally we’d only have two in each of those categories.

    Thanks in advance, Daniel. We appreciate how committed you are.

    #1794
    Daniel Tara
    Keymaster

    Hi,

    Showing the full content in the headline box is possible, if it’s giving you errors you’re doing something wrong. Here;s how the entire code should look:

    <div id="headline">
              <h3><?php _e('Headline','cover-wp') ?></h3>
              <?php query_posts("caller_get_posts=1&showposts=1"); $i = 1; ?>
              <?php if(have_posts()) : 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('Read entire article Β»'); ?>
                </div><!-- /the_content -->
              <?php endwhile; ?>
                <?php wp_reset_query(); ?>
              <?php else: ?>
                <h2 class="center"><?php _e('No Entries Found','cover-wp') ?></h2>
                <p class="center"><?php _e('There are no entries in this blog.','cover-wp') ?></p>
              <?php endif; ?>
            </div><!-- /headline -->

    You can replace the number of posts shown in the featured area by editing this line:

    [code]<?php query_posts (“caller_get_posts=1&showposts=3&category_name=”.get_option(‘cover_wp_featured_cat’, ‘Featured’)); $i = 1; ?>[/code]

    The argument [code]showposts[/code] gives the number of posts to be displayed.

    Now, to change the number of posts displayed in the popular section, you’ll have to open up functions.php and find the line:

    [code]if($ppl < 3) { ?>[/code]

    Change the number 3 πŸ™‚

    #1795
    Gamebynight
    Participant

    Beautiful Daniel, it worked like a charm. Thanks a lot.

    I have two follow up questions, if it’s not too much trouble. First, is there a way to make the post title a link from the homepage, similar to how it would work in blog format?

    Lastly, and this may be something obvious I’m missing (apologies if so), but is there a way to make those headline posts not display the thumbnail? Now that we’re using whole posts in the headline field, it won’t need it so much as just displaying normal format of the post (example, that first post is forcing the top image to left align for the thumbnail when the image is tagged center aligned). I definitely like how it includes them in the featured and popular sections, though.

    Again, much appreciation. Sorry for being a thorn in your side πŸ™‚

    #1796
    Daniel Tara
    Keymaster

    [quote]is there a way to make the post title a link from the homepage[/quote]
    Could you explain a bit please because I don’t understand what you mean.

    [quote]is there a way to make those headline posts not display the thumbnail?[/quote]
    The code I gave you above shouldn’t display the thumbnail. Anyway, stop the thumbnail from appearing remove the call to the function [code]display_thumbnail(230,165,$words,55);[/code]

    #1797
    Gamebynight
    Participant

    Sure, I apologize if that was unclear. What I mean is, is there a way to make the post title a link so that visitors can click on it to view a page with just that post. For example, [url=http://www.gamebynight.com]here’s my personal blog[/url]. If you are to click on the post title from that page, it will take you to another that feature just that post and the comments section. Essentially, the title would act as a link to the post page, [url=http://www.riftwatchers.com/?p=1]ala this[/url].

    Hm.. maybe it’s not actually thumbnailing that’s happening? If you go to the [url=http://www.riftwatchers.com]homepage[/url], you’ll see how the “Rift” logo appears left aligned. In the post itself, it appears centered on its own line. Could it just be left-aligning for some reason?

    #1798
    Daniel Tara
    Keymaster

    What you’re talking about are permalinks. The code I gave you above already has them, it’s this part: [code]<a” rel=”bookmark” title=”<?php _e(‘Permanent Link to’,’cover-wp’) ?> <?php the_title_attribute(); ?>”><?php the_title(); ?></a”>[/code]. Just that the code here adds an additional ” after the a. Just remove those and it should work.

    About the images in the headline, yes there is a problem and it’s not thumbnailing. I aligned all images to the left as I haven’t considered the full content to be inserted there. Open style.css and search for [code]#headline img[/code] and delete it. The problem is the [code]float:left;[/code] line from that instruction set.

    #1799
    Gamebynight
    Participant

    Great! I made those changes and this is now the perfect magazine-style theme for us. Thanks a ton, Daniel!

    Is there a way I can make a donation? I’d love to tip you for the help. πŸ˜€

    #1800
    Daniel Tara
    Keymaster

    Great! Glad I could help.
    Enjoy the theme and don’t worry about the donation πŸ˜‰

    #1801
    Gamebynight
    Participant

    Oh dear, Daniel, I’m sorry. Back again. I don’t know if I was so excited at the hoverlink or if I inadvertently deleted a character. When I hover over the hyperlink on the giveaway post on the main page, it goes to a cursor instead of being truly clickable. Halp? I know this is something basic and the link is active on the single post page. It’s times like these I wish I wasn’t such a code illiterate πŸ™

    I copied and pasted the code above, removed the quotations, and got the same thing. I wish I’d noticed this before promoting the giveaway πŸ™

    #1802
    Gamebynight
    Participant

    Apologies, I found our what was missing. I had inadvertently removed a section of “href” when applying the original code. Mistaken highlighting.

    I do have another question, though. I hadn’t considered this previously, but I’d like to do the same thing to stick posts as we did with the headline posts (allow whole posts to appear in their original formatting). I looked at the code and it seems pretty similar, but each time I try to tweak that section with code from the headline portion, it gives me a syntax error. I know it’s my fault, but would you be able to tell me what I should replace in the sticky section of home.php to accomplish what we did in the headline section?

    Thanks,
    Chris

    PS: Sorry to unresolve the topic. We’re running a giveaway and I’d like to capitalize on the extra traffic by putting up some more content. I want to sticky the giveaway post so it’s the first thing people see, though, since that will be what they come for initially.

    #1803
    Daniel Tara
    Keymaster

    Yep, it’s similar but there’s a slightly different approach there. Here’s the code you should put in:

    <div id="sticky">
              <h3><?php _e('Announcements','cover-wp') ?></h3>
            <?php while(have_posts()) : the_post(); ?>
                <h2><a" href="<?php the_permalink(); ?>" 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('Read entire Article Β»'); ?>
                </div><!-- /the_content -->
            <?php endwhile; ?>
            </div><!-- /sticky -->
    

    Watch out, it’s the same typo at the permalinks. Good luck with your giveaway.

    #1804
    Gamebynight
    Participant

    Cool, thanks Dan. Any idea how I’d get image captions to center align in the headline box? I’ve looked around in style.css and am only finding table options.

    #1805
    Daniel Tara
    Keymaster

    The caption is enclosed in a div with the class .wp-caption and the texe in class .wp-caption-text. I think you should add something line:

    #headline .wp-caption {
    position:relative;
    margin: 0 auto;
    }
    
    #headline .wp-caption-text{
    text-align:center;
    }
    #1806
    Gamebynight
    Participant

    Thanks, Dan. Can I just paste that anywhere in style.css?

    #1807
    Daniel Tara
    Keymaster

    Since you’ve already done modifications to the theme’s core, you can paste that directly in style.css. I recommend you put it at the very end of the file.

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in to reply to this topic.