Relative links for performance?

It’s a valid theory and under some circumstances such micro-optimization might make a difference (making content fit into single packet rather than be split into two). However you misinterpret the size information. 8.5KB is gzip-compressed version of your page. Since repeats of same string are highly compressible, your optimization won’t reduce this by 5KB. How … Read more

How to add wechat (weixin) link to navigation menu?

Filter kses_allowed_protocols (wp-includes/functions.php wp_allowed_protocols) to add your protocol: add_filter( ‘kses_allowed_protocols’, function( $protocols ) { $protocols[] = ‘weixin’; return $protocols; }); The default values are ‘http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, ‘news’, ‘irc’, ‘gopher’, ‘nntp’, ‘feed’, ‘telnet’, ‘mms’, ‘rtsp’, ‘svn’, ‘tel’, ‘fax’, and ‘xmpp’.

wp_get_attachment_link to add title attribute to link tag around image

I found a solution. Since the wp_get_attachment_link does not seem to work I solved this within an already used other filter:img_caption_shortcode Within this filter function the content variable contains the image link tag. Here a just added the title using a simple search and replace: $content = str_replace(“<a”,”<a title=””.$attr[“caption’] . $credit.”‘”, $content); This way it … Read more

Shortcode return function with link href inside PHP

You can use ob_start and ob_get_clean to print out your shortcode. function shortcode_html() ob_start(); ?> <div class=”boxed max-width”> <div class=”indice-title”> <span><?php echo $content; ?></span> <i class=”fa fa-twitter” aria-hidden=”true”></i> </div> </div> <?php return ob_get_clean(); } add_shortcode( ‘print_shortcode’, ‘shortcode_html’ );

Setting up navigation links for posts (first, prev, next, last)

This gist should get you started. <?php /* Plugin Name: Easy Pagination Deamon Plugin URI: http://wordpress.org/extend/plugins/stats/ Description: Offers the deamon_pagination($range) template tag for a sematically correct pagination. Author: Franz Josef Kaiser Author URI: http://say-hello-code.com Version: 0.1 License: GPL v2 – http://www.gnu.org/licenses/old-licenses/gpl-2.0.html Text Domain: pagination_deamon_lang Copyright 20010-2011 by Franz Josef Kaiser This program is free software; … Read more

Executing a shortcode from a “normal” text/hyperlink

Yes and no I created a shortcode named foo: add_shortcode( ‘foo’, ‘fooshort’ ); function fooshort( $atts ) { return “https://google.com”; } Then put this in a post: test [foo] The result: test https://google.com So if I take your question literally, yes, you can put shortcodes in anchor attributes. But the shortcode has no idea it’s … Read more