• Resolved warrengroom

    (@warrengroom)


    Hey there,

    I am using Ajax Load More: Previous Post so the user can have multiple posts on screen at once. Is there a way to include a print option that will only print the current post that is in view?

    Cheers,

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi,
    You would have to use CSS in your print stylesheet.

    Try this.

    @media print{
       .alm-previous-post{
          display: none;
       }
       .alm-previous-post:first-of-type{
          display: block;
       }   
    }

    Cheers,

    Thread Starter warrengroom

    (@warrengroom)

    That works great for printing the first post, do you think there’s a work around for printing the current post – the post that’s showing in the url?

    Cheers,

    Plugin Author Darren Cooney

    (@dcooney)

    Oh, got you.
    Not that I can think of. There isn’t a way (out of the box) to determine which post is currently in view.

    Thread Starter warrengroom

    (@warrengroom)

    That’s what I suspected, but it was worth the question.

    Thank you, and thanks for such an amazing plugin.

    Have a good one.

    Plugin Author Darren Cooney

    (@dcooney)

    Thanks! If I think of something I’ll post back here.

    Thread Starter warrengroom

    (@warrengroom)

    F.Y.I. not the cleanest solution, but I’ve used this code which opens the current post in a new tab and automatically starts the print process:

    <a href="javascript: w=window.open('<?php the_permalink() ?>'); w.print();" >​​​​​​​​​​​​​​​​​<i class="fa fa-print fa" aria-hidden="true"></i></a>

    It could be adapted to open a pop up window rather than a tab, which might be nicer.

    Cheers,

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Ajax Load More: Previous Post – Print current post only’ is closed to new replies.