Viewing 1 replies (of 1 total)
  • Thread Starter chicho1969

    (@chicho1969)

    done !… I explain it if can help!

    With a shortcut function from here. Thanks to Neil.

    I place this function in my functions.php

    add_shortcode ('geturl', 'get_current_page_url');
    function get_current_page_url() {
    	$pageURL = 'http';
    	if( isset($_SERVER["HTTPS"]) ) {
    		if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
    	}
    	$pageURL .= "://";
    	if ($_SERVER["SERVER_PORT"] != "80") {
    		$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    	} else {
    		$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    	}
    	return $pageURL;
    }

    And them, I just add this to a text widget

    <p><a target="_blank" href="[geturl]?wpp_export=print"><img src="https://.....">?? Print</a></p>

    After it I just hide the “oficial print button” with css.
    and that works fine for me.

    Hope this can help.

Viewing 1 replies (of 1 total)
  • The topic ‘print button in sidebar’ is closed to new replies.