CSS paginated post

  • Unknown's avatar

    Hi everybody,
    Wishin’ this message finds you in good health and spirit.
    I’m running a magazine-based blog/site, and I’m encountering a bunch of problems with the customization of the first page of a paginated post.
    As a matter of fact, after countless researches, I haven’t found a way to delete the author box nor the comment form appearing on the first page and therefore not makin’ sense as you would normally expect them to be at the very end of the post…

    The block of code I’m using at the mo’ is as follows, allowing me for instance to not have anymore the tags or the social network buttons appearing down to the first page which means the instances are right, but I have a recurent prob with the comment form and the author box…

    There you go

    .single .tag-paginated + #respond {
    	display: none;
    }
    
    .single-paged-2 .tag-paginated + #respond {
    	display: block;
    }
    
    .single .tag-paginated .post-tags, .single .tag-paginated .sharedaddy {
    	display: none;
    }
    
    .single-paged-2 .tag-paginated .post-tags, .single-paged-2 .tag-paginated .sharedaddy {
    	display: block;
    }

    The prob would be solved with a php conditional but not working on these shores, so warm thanks in advance for letting me know about a CSS workaround

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there, can you point me to a post with pagination? I’ve clicked on a number of them but haven’t found one yet.

  • Unknown's avatar

    Even if the page is unpublished, that is fine. Just give me the title and I can see it in your dashboard and preview it.

  • Unknown's avatar

    Hi, Sir. There you go: http://indamixworldwide.com/2014/11/28/joey-negro-joins-the-house-masters-series-interview/
    It’s a 2 page post as you may see, and although I’ve managed to get rid of the tags and the sharedaddy thing at the bottom of the first page of the article, I still have the authorbox and the comment form down to it, which doesn’t make sense, as you would normally see them at the very end of the post itself, meaning on page 2, or eventually 3 or 4 if these are longer posts, right?

    You can check whatever in the Interviews/Portraits subcategories, from Features…

  • Unknown's avatar

    Ok, this is a little bit of trickery with CSS. The first page of the post does not have a body class that we can use to target the first page, so what we can do is to hide the authorbox and the comment section entirely from that post, and then un-hide it for the second page, which does have a unique body class (.single-paged-2).

    .postid-17684 .author-box, .postid-17684 #respond {
    display: none;
    }
    
    .postid-17684.single-paged-2 .author-box, .postid-17684.single-paged-2 #respond {
    display: block;
    }

    Note that if you have another post, or in the future have a post that has 3 or more pages, then the authorbox and comments section will not appear on page 2, but would display on 3, 4, etc., so additional rules would have to be created to deal with page 3, 4, etc. as needed.

  • Unknown's avatar

    Thank you for the tip. It’s weird though as the code I gave you is working along with the tags and the social networks.
    With yours I understand that I’ll have to do this manually each week then.
    It’s so weird that WordPress hasn’t thought about a solution for this situation. Could be a good suggestion in the future, as I’m sure I’m far from being the only in this position…
    Warm thanks for your help, Gentleman. Wishin’ you and yours a beautiful day ;)

  • Unknown's avatar

    In your selectors, you are targeting one of the tags you assigned to the post, and that works as well if you only have 2 pages, but if you go to 4, and then add to hide the authorbox and comments on .single-paged-3, any pages with ONLY 3 will NOT have the comments or author box. That is why I chose to do it be post ID.

    To do this the proper way would require some PHP script, but we cannot edit the theme PHP script files here at WordPress.com.

  • Unknown's avatar

    That makes full sense. I know it’s a php conditional that needs to be inserted, and I’ve talked about it to one of your colleagues on chat for a suggestion in a forthcoming update of WP as it’s something which might be of a definitive help for bloggers in that situation as opposed to manually do the coding from one post to another. We have a weekly interview / portrait, from two to four pages so far…

  • Unknown's avatar

    Yeah, I’m sort of on the fence on hiding comments on all but the last page of a paginated post. I might be reading page 3 of 5 and see something on that page that I wish to comment on, but I would have to go to the last page to enter my comment. Depending on how strongly I felt about commenting, would weigh on whether I would switch to the last page, comment and then switch back to page 3 to continue reading.

    The about box I’m sort of on the fence about also. It might be nice to see something about the author while I’m in the middle of a paginated post, but then again, it would keep things cleaner to have it only on the last page of the post.

    Is that wishy-washy enough?

  • Unknown's avatar

    This is something that should definitely be considered for an update to defo sort this kind of problem.
    With warm thanks for your kind input…
    All the best & speak soon,
    Peace,
    Frederic

  • Unknown's avatar

    You are welcome, Frederic.

  • The topic ‘CSS paginated post’ is closed to new replies.