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

How to remove author name and link from a shared link preview?

This might help you. Add this script to functions.php. It will unset author from oembed preview. Remember Discord might already cached your URL. You may not get immediate result. add_filter( ‘oembed_response_data’, ‘disable_embeds_filter_oembed_response_data_’ ); function disable_embeds_filter_oembed_response_data_( $data ) { unset($data[‘author_url’]); unset($data[‘author_name’]); return $data; } for more explanation head over here

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)