Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1321873

    i use enfold for my recipe collection. can you recommend a plugin with which I can print a page like this one?

    https://cookinggrannies.com/gebatener-zander-von-opa-werner-rezept-video-cooking-grannies/

    That would be super helpful for the visitors to my website. A print button, so to speak. Maybe something like that will come soon for the ALB, or does it already exist? Just an icon that you can insert manually on the page which then creates a print preview. Thank you very much, Alexander

    #1321907

    Well a print page button is easy to get – as shortcode by this snippet in child-theme functions.php:

    function print_button_shortcode($atts){
    return '<a class="print-page" href="javascript:window.print()">Print This Page</a>';
    }
    add_shortcode( 'print_button', 'print_button_shortcode' );

    class “print-page” is for styling that button – usage is via shortcode: [print_button]
    Styling may contain an image than a Text to show

    But: there are a lot of print plugins – where you can influence the parts of your page to print ( f.e. by class )
    Print-O-Matic f.e.

    #1321924

    Wow, thank you Guenni007. !!!!!

    So i insert this code in the child-theme functions.php . ok, but at which position and can I add a comment so that I know again in a year what the code is good for :) Can you do that with * / or with which code?

    And then i add this code: [print_button] to a code container from ALB. will an icon be displayed with which I can “print” and can I define this ivon and its size? many many thanks!

    #1321951

    you can use the shortcode whereever you like even in widgets or text-alb element
    If it is in child-theme functions.php you can have comments in one-liner by //
    or in more lines by /* your text */
    or like i do for my snippets – give the function a meaningfull name – i think “print_button_shortcode” is unique enough to remember what function it is.

    f.e.

    // shortcode for print page button
    function print_button_shortcode($atts){
    return '<a class="print-page" href="javascript:window.print()">Print This Page</a>';
    }
    add_shortcode( 'print_button', 'print_button_shortcode' );
    #1322055

    Hi,

    Thanks for your help @Guenni007 :)

    Best regards,
    Yigit

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.