Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*********
- image link or featured image
- **********/
- $image_id = get_post_thumbnail_id();
- $image_url = wp_get_attachment_image_src($image_id,'thumbimage');
- $image_thmb = $image_url[0];
- '.$image_thmb.'
- /*
- example:
- <img src="'.$image_thmb.'" alt="">
- */
- =============================================================================
- /*********
- title
- **********/
- '.get_the_title().'
- /*
- example:
- <h3>'.get_the_title().'</h3>
- */
- =============================================================================
- /*********
- content
- **********/
- '.get_the_content().'
- /*
- example:
- <p>'.get_the_content().'</p>
- */
- =============================================================================
- /*********
- excerpt
- **********/
- '.get_the_excerpt().'
- /*
- example:
- <p>'.get_the_excerpt().'</p>
- */
- =============================================================================
- /*********
- permalink
- **********/
- '.get_permalink().'
- /*
- example:
- <p>'.get_the_excerpt().'</p>
- */
- =============================================================================
- /*********
- id
- <?php the_ID(); ?>
- **********/
- '.get_the_ID().'
- /*
- example:
- <div id="image-modal'.get_the_ID().'" class="mfp-hide modal-box">
- */
- =============================================================================
- /*********
- image link
- **********/
- $mixlargeimage = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'mlimage');
- /*
- example:
- $mixlargeimage = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'mlimage');
- <img src="'.$mixlargeimage[0].'" alt="">
- */
- =============================================================================
- /*********
- custom field
- **********/
- $idd = get_the_ID();
- $edic = get_post_meta($idd, 'edic', true);
- '.$edic.'
- /*
- example:
- <i class="fa fa-'.$edic.' eduicon"></i>
- */
- =============================================================================
- /*********
- shortcode into shortcode
- **********/
- '.do_shortcode($content).'
- /*
- example:
- <ul class="resumeList"> <li><h3>'.$title.'</h3></li>'.do_shortcode($content).'</ul>
- */
- =============================================================================
- /*********
- if else elseif into shortcode
- **********/
- extract( shortcode_atts( array(
- 'icon' => '',
- ), $atts ) );
- if($icon) :
- $list .='<i class="fa fa-'.$icon.' staticon"></i> ';
- elseif($amount) :
- $list .='<h3 class="statamnt">'.$amount.'</h3> ';
- else :
- $list .=' ';
- endif;
- =============================================================================
- /*********
- for get post thumbnail
- **********/
- '.get_the_post_thumbnail().'
- =============================================================================
- ছোট্ট একটা টিপস
- =========================
- শর্টকোডে কাস্টম পোস্ট নেওয়ার সময় get_the_content() ফাংশনকে কল করলে p ট্যাগ জেনারেট হয় না, কিন্তু যদি p ট্যাগ জেনারেট করতে চাই, তাহলে যেটা করতে হবে:
- প্রথমে get_the_content() ফাংশনকে ভেরিয়েবলে নিতে হবে
- $my_p_tag = get_the_content();
- তারপর যেখানে কনটেন্ট নিব, সেখানে ব্যবহার করতে হবে
- wpautop( $my_p_tag );
- তাহলে auto p ট্যাগ জেনারেট হবে। বিস্তারিত: http://codex.wordpress.org/Function_Reference/wpautop
- ?>
Advertisement
Add Comment
Please, Sign In to add comment