I’m getting invalid taxonomy in init action
I’m getting invalid taxonomy in init action
I’m getting invalid taxonomy in init action
It appears like you can not use upper case like that in a shortcode. Instead of videoUrl, use video-url: function get_youtube_thumb_url_func( $atts ) { $atts = shortcode_atts( array( ‘video-url’ => ‘urlHere’, ), $atts, ‘youtube-thumb-url’ ); return $atts[‘video-url’]; } add_shortcode( ‘youtube-thumb-url’, ‘get_youtube_thumb_url_func’ ); And your shortcode: [youtube-thumb-url video-url=”test”] This is the final function that I tested … Read more
That error means you’re attempting to address a string or null as if it were an array. Perhaps it’s returning fewer than 5 matches, in which case $array[0][4] would be unset. Here’s your problem: function thing($content) { preg_match_all(“/(<h[^>]*>.*?<\/h2>\n*<p>.*?<\/p>)/”, $content, $array); $i = 1; $limit = count($array[0]); $array = $array[0][4]; // you’ve overwritten $array with what … Read more
Add this code to your theme’s functions.php file, and it will limit image dimentions add_filter(‘wp_handle_upload_prefilter’,’tc_handle_upload_prefilter’); function tc_handle_upload_prefilter($file) { $img=getimagesize($file[‘tmp_name’]); $minimum = array(‘width’ => ‘600’, ‘height’ => ‘900’); $width= $img[0]; $height =$img[1]; if ($width < $minimum[‘width’] ) return array(“error”=>”Image dimensions are too small. Minimum width is {$minimum[‘width’]}px. Uploaded image width is $width px”); elseif ($height < … Read more
If all you want to do is count how many times the shortcode exists in the content then you can use substr_count on the original content before it’s parsed to output shortcodes like this: $count = substr_count( get_the_content(), ‘[col]’ ); But nesting shortcodes is most likely the best solution unless you know exactly the type … Read more
Load scripts into an AJAX div
Load scripts into an AJAX div
Finally I solve the problem. Here the code bellow for download button. Put this code into your post loop it will show a download button. <form action=”<?php echo esc_url( home_url( ‘/your_redirected_page_slug’ ) ); ?>” method=”GET” id=”form1″> <?php global $post; //$post_slug=$post->post_name; ?> <input id=”myButton” type=”submit” name=”a” value=”Download” class=”single-download-button” /> <input type=”hidden” name=”appk” id=”mkval” value=”<?php echo get_the_ID(); … Read more
You could do something like this: /* Add disclaimer to top of POSTS that contain affiliate tag */ function tt_filter_the_content( $content ) { if (has_tag(‘affiliate’) && is_single()) $custom_content=”<hr><p><em>Disclosure: This post contains affiliate links and we may receive a referral fee (at no extra cost to you) if you sign up or purchase products or services … Read more
Placing CSS/ JS into the header or footer (inline) – trying to apply to several templates