Forum Replies Created

Viewing 3 replies - 16 through 18 (of 18 total)
  • Yes Why Not.. I would not like to list my email ID on public, hence pls visit the blog and leave a comment or visit the about page > contact my mail is listed

    https://tskamath.pactindia.net/technology/wordpress/shortcode-get-custom-field/

    Thread Starter Srikanth Kamath

    (@tskamath)

    marked this as solve.. my error, I had deleted all the taxonomies in ‘ip_ratings’

    just get a test with var_dump..

    <?php
          global $post;
          echo  'post ID :' . $post->ID . '<br />';
          $lists = echo get_the_term_list($post->ID, 'ip_ratings', 'Camera IP Ratings: ', ', ', '' );
          var_dump($lists); // => bool(false)
    ?>

    hi, may be this will help

    using the plugin “ShortCode Exce PHP” we can create a shortcode, which we can then insert in the post or page. [get_Field arg=”custom_field_slug”]

    create a shortcode as detailed in my post
    pls note, I am using the same to get custom field values from the Post ItSelf, in case you want the CF from other post then, modify the following

    Btw I am trapping the error.. code will display the error and also the available fields on the post, so that you can correct any typo, etc. ScreenShot

    $AllFields = CFS()->get(false);
    $AllFields = CFS()->get(false, $post->ID);
    // $AllFields = CFS()->get(false, 492); // the post id is 492 //
    $getFields = CFS()->get($arg); // need to change $getFields = CFS()->get($arg, 492);

    is such a case its better to pass two arg to the short code

    extract(shortcode_atts(array('arg' => 'default'), $atts)); /change to
    // extract(shortcode_atts(array('arg1' => 'field-slug', arg2 => 'post ID'), $atts));

    of course, pls feel free to edit to your content. “ShortCode Exce PHP” allow a fast interface also to check the PHP..

Viewing 3 replies - 16 through 18 (of 18 total)