• Resolved BeatsByBros

    (@beatsbybros)


    I can’t seem to figure this one out, and I haven’t been able to find any posts having similar issues.

    I have posts from certain categories going to the homepage, as well as their own pageofposts. That is working fine, but the formatting seems to be a little off. When displayed on the homepage, the posts have proper spacing between paragraphs and wherever spacing was added. However, on the pageofposts pages, the spacing is no longer there, so everything is kinda mashed together into one chunk. If I click on the post to view it from the pageofposts, the spacing is once again there. So it just seems to be a problem with the pageofposts specifically. Not a HUGE issue, but definitely something I would like to get fixed.

    Here is the code I am using for the pageofposts template:

    [code moderated – please use the pastebin – see forum rules]

    Thanks.

Viewing 13 replies - 1 through 13 (of 13 total)
  • please make sure that the PageOfPosts template uses the same html structure as your theme;

    the example in the codex was for the former default theme ‘kubrick’ and will not match most other themes.

    @alchymyth: I updated that Codex section early yesterday to incorporate a simplified PageofPosts template based on Twenty Eleven. There is a warning about modifying the markup to suit your theme in there too. πŸ™‚

    Thread Starter BeatsByBros

    (@beatsbybros)

    Ok, well I got the code for Graphene (the theme I’m using) here:

    http://pastebin.com/jUyuGmtK

    The way I was “calling” the categories before was from a custom field called ‘category’ which I don’t see in the code now. How exactly do I designate which category I want it to retrieve?

    which I don’t see in the code now

    That code is still there – just a little further down that Codex page.

    Thread Starter BeatsByBros

    (@beatsbybros)

    Hmm, I guess I just don’t see it. I was looking for something similar to:

    $category = get_post_meta($posts[0]->ID, 'category', true);

    The closest I found on this new one is:

    'category__in' => $cat,

    Maybe I’m just missing it?

    @esmi
    re:

    @alchymyth: I updated that Codex section early yesterday to incorporate a simplified PageofPosts template based on Twenty Eleven. There is a warning about modifying the markup to suit your theme in there too. πŸ™‚

    I know πŸ˜‰ I saw one of your replies yesterday, mentioning it – therefore I worded my reply here ‘the example in the codex was for ….’
    (the moderated code in the first post of this topic here contained the ‘kubrick’ formatting…)

    Thread Starter BeatsByBros

    (@beatsbybros)

    Alchymyth,

    It looks like you were the one who pasted that code for Graphene. Are you able to direct me how I can call a specific category using the code you provided and Custom Fields? I am unable to figure out where in the code I am able to do this.

    Thanks.

    it might help, if you could post a link to the problem page(s);

    are you sure about the page IDs used in the conditional statements at the start of your page template?
    are you aware that you could use page slugs as well?

    if you want to use custom fields, try to replace line 11 to 17 of the pastebin with:

    $category = get_post_meta($posts[0]->ID, 'category', true);
    $cat = array();
    if( $category ) { $cat = array(get_cat_ID($category)); }

    the custom field with the key ‘category’ would need to contain the category name.

    Thread Starter BeatsByBros

    (@beatsbybros)

    It’s not so much anything with the webpage in particular, more just of me not understanding how to use a Custom Field for ‘category’ using that code from pastebin. I did try what you suggested, and it seems like what I’m trying to accomplish, but didn’t quite work when I replaced the code.

    I ended up getting this error:

    Fatal error: Call to a member function have_posts() on a non-object in /hermes/bosweb/web041/b415/ipg.beatsbybroscom/wp-content/themes/graphene/pageofposts2.php on line 26

    The first bit of my code looks like this:

    http://pastebin.com/HLQxx1Ts

    try to add a opening php tag at the start of line 11:

    <?php $category = get_post_meta($posts[0]->ID, 'category', true);

    (my mistake – I should have said: replace line 12 to … πŸ˜‰

    Thread Starter BeatsByBros

    (@beatsbybros)

    Ok, yes that works after changing line 15 from:

    $showposts = -1; // -1 shows all posts

    to

    $showposts = 8; // -1 shows all posts

    I was trying to set it up for 8 posts per page. Also, with “-1” nothing displayed on the page.

    Just one more thing now that I’ve just noticed, the bottom of the page doesn’t show a ‘Previous Posts’ or ‘Older Posts’ link to look at anything before this list of most recent posts. Is there a way that I can add this?

    Sorry for all the questions that keep coming up.

    Thread Starter BeatsByBros

    (@beatsbybros)

    FYI, here is my entire code:

    http://pastebin.com/J9svSptC

    This topic is very helpfull, I have the same problem and this explains a lot! So thanks!

    Just one question: where do I find the code I need for my theme (Twenty Ten Child)?

    Thanks so much!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘PageOfPosts paragraph spacing/formatting is incorrect’ is closed to new replies.