Create a shortcode to display the “the_content ()” in my post [closed]

Here is an example of a shortcode that renders post content based on the id and type attribute. [post type=”content” id=”2″] [post type=”title” id=”2″] If you want to render from a template you would use: echo do_shortcode ( ‘[post type=”content” id=”294″]’ ); echo do_shortcode ( ‘[post type=”title” id=”294″]’ ); And here is the actual shortcode … Read more

How Do I create a shortcode to dispaly a go to top button on any page or post

Hi You can use this below code in your function.php add_action( ‘init’, ‘register_shortcodes’); function register_shortcodes(){ add_shortcode(‘go-to-top’, ‘gtp_function’); } function gtp_function($atts) { extract(shortcode_atts(array( ‘text’ => ‘<i class=”fa fa-arrow-circle-up fa-3″></i>’, ‘speed’=>500, ‘bottom’=>20, ‘right’=> 20 ), $atts)); ?> <script> $ = jQuery.noConflict(); (function($){ $.fn.addScrollToTopButton = function(options){ var $t = $(this); var settings = $.extend({ text : “<a href=”#” … Read more

Shortcode – Display inline icon before text [closed]

Your shortcode is not echoing the html in the right way. You have <span class=”icon”> <img …> </span> <span class=”text”> <span class=”title”> … </span> <span class=”description”> … </span> </span> In this way you cannot put icon and title inline. You need: <span class=”icon-title”> <img …> <span class=”title”> … </span> </span> <span class=”description”> … </span> This … Read more

create shortcodes for posts

Your shortcode name and shotrcode_function_name are dynamic i.e vary with post name, which cause problem if you have same post title for two post. Also, you may not know or may be confused what shortcodes are available. I recommend to do this if your post title will always be unique. while ($query->have_posts()) { $query->the_post(); $shortcodename … Read more

Shotcode error on functions

do_action is a WordPress function for running action hooks. I assume that is what you are trying to do. Given that, The first parameter, the only one in your case, needs to be an action hook name. If you pass it a valid hook name and have a function attached to that hook, this code … Read more

Shortcode conversion to hrml when post is published

You can use the pre_post_update filter hook to achieve this. Unfortunately the Codex isn’t very good for this hook, but it’s a simple enough one to understand and can be found in wp-includes/post.php on line 3335 (WP 4.1). add_filter( ‘pre_post_update’, ‘my_replace_shortcode’, 2, 99 ); function my_replace_shortcode( $post_id, $data ){ if(strpos($data[‘post_content’], ‘[myshorcode param1=”‘) !== false) : … Read more

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