• Resolved gailwingate1

    (@gailwingate1)


    Hi, I’m very new to this, while I read through the documentation on how to display the fields, I just don’t understand the code and where to put it, and whether or not I need an array. I do see the fields when I add a new post, I just don’t understand how to display them.

    I’m using the Category Post List Widget (https://www.ads-software.com/plugins/category-post-list-widget/) to display my posts. The plugin produces the following code for my page:

    [cplw category=”19″ width=”500″ height=”500″ effects=”none” posts_to_show=”-1″ time=”1000″ sort_by=”date” excerpt_length=”10″ thumb_width=”150″ thumb_height=”150″ date_format=”F j, Y” display=”title,excerpt” customfield_display=source customfield_display_name=no order=”desc”]

    You can see I tried to display my custom “source” field, but it doesn’t show. There are two other fields that I need to display, “source_website” and “direct_link_to_content” which are both hyperlinks. I thought I would try to get the “source” working then add the other two.

    What do I do with the API’s that are provided by your plugin? I’m using the Nirvana theme, by the way. I also have Code Snippets and Simple Custom CSS plugins installed.

    Any help is very much appreciated.
    Regards, Gail

    https://www.ads-software.com/plugins/custom-field-suite/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Matt Gibbs

    (@mgibbs189)

    Please see the introduction: https://customfieldsuite.com/docs/how-to-use-cfs/

    You will need to add PHP code to your template files. The shortcode you shared has nothing to do with CFS.

    Alex

    (@alexgruppo)

    Hi Matt,

    I have the same problem: where exactly and on which file I can place the php code to output the custom fields? I would really appreciate some detailed info since all info I found so far about this plugin are very generic….!

    Thanks

    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..

    Alex

    (@alexgruppo)

    Hi tskamath,

    Thank you for your reply but the shortcode does not seem to work.
    Is there any way that I could contact you in private?

    As I need to make this work for a website hosting over 700 events.

    Thanks,

    Alex

    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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Displaying Custom Fields’ is closed to new replies.