WordPress.org

Ready to get started?Download WordPress

Forums

Organising and inserting content (12 posts)

  1. Jinsan
    Member
    Posted 9 years ago #

    http://reviews.sekhu.net/
    http://reviews.sekhu.net/category/film

    In the first link each box will contain an exercpt. This bit I understand - use the excerpt tag and place where needed, excluding the cats I don't want and limiting it to one entry.

    The second link is what will displayed when the user clicks on the excerpt.

    In the first box in the second link I want to include the content up to the point where it says "more". The second box will contain the previous entry in the same fashion.

    When the user clicks either entry, it will display the full entry for that post. What tags, code do I need to make this work?

    I've looked at other themes, and tried this:

    <?php
    if ($posts) {
    foreach($posts as $post) { start_wp();
    ?>
    <br />
    <a class="title" href="<?php the_permalink() ?>" style="text-decoration:none;" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a>
    <div class="cite"><?php the_time("l F dS Y") ?>, <?php the_time() ?> <?php edit_post_link(); ?><br />
    <?php _e("Filed under:"); ?> <?php the_category(',') ?></div>

    <?php the_content(); ?>

    But I got a load of php errors, and everytime I fixed it, it buggered up even more.

    1) Could the content be displayed in single.php by just using <?php the_content(); ?>

    2) Would I do the same to display the content up to "more" on the second link?

    Thanks in advance

  2. Root
    Member
    Posted 9 years ago #

    Dont complicate yourself. The default behavior is that if you click on more, the title or a bunch of other stuff you get the full single post. No need to reinvent the wheel.

  3. Jinsan
    Member
    Posted 9 years ago #

    I understand what you're saying - but what I'm trying to do is get the more tag with the excerpt in the first link. SO it displays the content excerpt, and then a more link at the bottom.

    The specific category page would display in the second link as is. So the first entry woudl have all the content up to more, the second box the previous entry up to more and the latest reviews the latest entries for that category.

    I'm just trying to figure out what I need to get things to display in that manner - ie. excerpt with more - seeing as the title of the post won't be displayed. This theme's being made from scratch so there's no actual code with regards to posts or even comments yet.

  4. RosieMBanks
    Member
    Posted 9 years ago #

    Category template page? Heh! I have absolutely no idea what I'm talking about.

    What you want to do, Jinsan, is what I want to do. I asked for assistance with this and got several helpful replies.

    Here is the post in which Kafkaesqui mentions his excerpt reloaded plugin.

    I can get the excerpt on the homepage (and would be happy with excerpt OR content on category pages) but I'm still having formatting issues, which brings me to the second link.

    I never did figure it out, so I'll be watching what you do.

    And you know what, I don't even write regularly in a blog. I just have fun playing with WordPress and hacking away at all the different themes.

  5. Jinsan
    Member
    Posted 9 years ago #

    Damn this is a little more than confusing. Now...the excerpt_reloaded plugin is excellent, but I need to to specify excerpts from specific categories.

    RIght now I;m using the C2C plugin to grab the excerpt from category x.

    How would I use the excerpt plugin to to decide how the excerpt will display while retaining the rules for the C2C plugin - for example I could set the C2C plugin to ignore posts from category x, only to post from category y and to only display one post. If I placed the excerpt_reloaded code into the relevant category box, will it overide or work with the other plugin? Messy.

    <?php the_excerpt_reloaded(15, '<img><a>', 'excerpt', TRUE, 'continue reading >>', TRUE, 1); ?>

    That's te code for the rloaded plugin I want to use, and for the C2C plugin I'm using:

    <?php c2c_get_recent_posts(1, "%post_excerpt%", "2"); ?>

    Suggestions?

    Rosie what problem are you having with regards to formatting?

  6. RosieMBanks
    Member
    Posted 9 years ago #

    When I use the excerpt reloaded plugin (or when I just call the excerpt without using the plugin) all the formatting is stripped from it.

    It's been a while since I tried using an excerpt, so I'll just see how you solve this problem, and then try it myself. And if the formatting still messes up, I'll ask for help again.

    I should be ironing right now, or filing, or maybe even making my writing deadline instead of blowing it off to sprint through these forums. It's just too much fun to mess with stuff like this instead.

  7. Jinsan
    Member
    Posted 9 years ago #

    Well with the original excerpt I believe it strips out the formatting - don't quote me on that. With the excerpt reloaded you have to define what tags will be kept for formatting, with the default being <a>. So if you want to include things like <b> etc you would place that in the call for the excerpt reloaded.

  8. Jinsan
    Member
    Posted 9 years ago #

    Ok having played with it a little more, I now understand that I don't understand the minium code I need to get any content to show. For example
    * made a post which has no link - it uses the excerpt
    * but can't use the more tag unless it uses the excerpt_reloaded which then hangs at the bottom
    *I can't limit the number of words in the excerpt as there is no fucntion in C2C plugin

    *checked the codex, very limited info on what code you need - tells you what the templates are, but I couldn't find the code.
    * clicking on "more" using excerpt reloaded leads to the relevant category, click on the post displays the same page rather than an individual page to display the entire content.

    Seeing as this is a theme from scratch pretty much with only the HTML and CSS added so far, I'm going to need help in putting the php code and calls in. I'll be willing to pay, if it means I get the site completed and working.

    Cheers

  9. Root
    Member
    Posted 9 years ago #

    Am I right in saying that the excerpt plugin has been overtaken by WP and that excerpt fuctionality is now built in (if you know the tag) with a variable for the number of words ?. Next up Jinsan you need to make a management choice about whether it is easier to fit my mock up into a working WP page or to put the loops into your design. Either way without a full loop there is going to be no content so that is the starting point. Step 1. Get it running in one box. Then go from there ? So Just copy a full loop from somewhere and paste it into one box.
    Adjust in admin for one single post temporarily. Then edit for single cat single post. Then repeat.

  10. Jinsan
    Member
    Posted 9 years ago #

    Root you are correct. My plan was to use the design in an existing theme, negating the need for reinventing or creating a new wheel. It's turned out that it's easier to work with by starting from scratch as far the design is concerned. As for what's easier, that's the bit I'm stuck at, using any exiting "loop" from a theme seems not work well.

    There are two excerpt plugins as neither does what the other one does, so it's all a bit tits up in that respect. There's no lopp excerpt as there's no loop right now.

    Are you suggesting I may need a seperate loop for each box? I am aware that I need the loop but it's just not working. What I might try is using an existng theme and copy the design over that. It's a shame that there isn't one catch-all-template that simply lets you design the aesthetics, but retains the code so that it can be easily adapted with a few changes.

    Hard work, indeed.

  11. Root
    Member
    Posted 9 years ago #

    Well. The way my multiple loop works is that it does its thing then the template generates html then it loops again. I had to thread the loop in bits thru the html markup.I found it difficult and a lot of guys pitched in to help. But there really is no tutorial or anything to point to.

  12. Jinsan
    Member
    Posted 9 years ago #

    The suggestion that there is no tutorial is rather disheartening - I mean it can be done but no one can say for sure how, right? If the worst happens I could transfer the design to another program, perhaps a CMS of some type.

    I entered some element of the loop here as stated: http://wordpress.org/support/topic.php?id=31175

    But if I use that first line in the loop:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> it kills the page with a php error. Just using that alone breaks the site, so until I can get that within the template to work, the rest of the loops are, I guess, uselss?

    So what would you recommend? What are my options in getting this to work? Give up? Try another package? It might save us both some grief I guess :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.