Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    To use via shortcode in the WordPress editor you’ll need to make your own shortcode that looks something like this (put it in your functions.php file):

    
    // Use the shortcode: [airpress-record-count]
    function create_airpressrecordcoun_shortcode() {
    global $post;
    if ( is_airpress_empty($post->AirpressCollection) ){
       return 0;
    } else {
       return count($post->AirpressCollection);
    }
    add_shortcode( 'airpress-record-count', 'create_airpressrecordcoun_shortcode' );
    

    I have not tested this code.

    Thread Starter mimv

    (@mimv)

    Thank you for the super fast reply, also thank you for the amazing plugin
    We use your plugin on non profit organization website that try to find lost kids and return them back to there family.

    It’s in Arabic 🙂 But you will understand the idea
    http://www.atfalmafkoda.com/cases/

    It will be nice if you can put this useful shortcode on your next update.

    One more thing…

    I can get the airpress data if I use
    [apr field=”Name”]
    But I can not get the data if use
    {{Name}}

    Unless I add
    [apr_loop]
    {{Name}}

    Is there a way to use {{Name}} without [apr_loop]

    I can not use [apr field=”Name”] sometimes because the wordpress theme have shortcodes and I notice it does not work if I add shortcode inside shortcode like this…
    [fusion_imageframe image_name=”[apr field=’Name’]” image_url=””]

    So I must use this
    [fusion_imageframe image_name=”{{Name}}” image_url=””]

    Thank you

    Plugin Author Chester McLaughlin

    (@chetmac)

    So happy I can be a small part of your GOOD WORK!

    Again, this code is untested, but the idea is to create your own shortcode that runs BOTH the Airpress shortcode and Fusion shortcode:

    <?php
    // Use the shortcode: [custom_fusion_imageframe image_name="My Image Field|filename" image_url="My Image Field|thumbnails|large|url"]
    function create_customfusionimagef_shortcode($atts) {
    
    	// Attributes
    	$atts = shortcode_atts(
    		array(
    			'image_name' => 'The Image Name',
    			'image_url' => 'The Image URL',
    		),
    		$atts,
    		'custom_fusion_imageframe'
    	);
    	// Attributes in var
    	$image_name = do_shortcode( sprintf('[apr field="%s"]',$atts['image_name']) );
    	$image_url = do_shortcode( sprintf('[apr field="%s"]',$atts['image_url']) );
    
    	return do_shortcode( sprintf('[fusion_imageframe image_name="%s" image_url="%s"]',$image_name,$image_url) );
    	
    }
    add_shortcode( 'custom_fusion_imageframe', 'create_customfusionimagef_shortcode' );
    ?>
    
    Thread Starter mimv

    (@mimv)

    Thank you, Is there anyway to get single item from array via {{images|url}} something like do {{images|url single}} ?

    I know you can do that by [apr field=”images|url” single] but I want use {{ }}

    Plugin Author Chester McLaughlin

    (@chetmac)

    Try:

    {{images|0|url}}

    Thread Starter mimv

    (@mimv)

    IT WORKED 🙂
    Thank you… I wish you document this amazing tips.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Anyway to get record numbers from inside a virtual post’ is closed to new replies.