We're merging with GenerateBlocks! Learn more here.

[Support request] field of custom post type

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support field of custom post type

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #705
    David
    Participant

    Hi Tom! Congratulations for your new plugin WP Show Posts … It’s amazing !!

    This plugin, lightweight and generate are tools that work daily. Easy and intuitive for graphics designer like us who do not have much knowledge of programming designers.

    I write because I have a problem and although I have been reading the support forum and I’ve tried many things I can not put a field on a custom post type to display with WP Show Posts.

    I sent a picture for you to see what I want to do. I need it!

    Can you help me with this? Thanks!

    #715
    Tom
    Keymaster

    Hi there,

    Glad you like the plugin!

    How are you adding the custom fields? Are you using a plugin or manually creating the metaboxes? Or maybe using custom fields?

    Something like this should make it work: https://wpshowposts.com/support/topic/custom-fields/#post-220

    Let me know 🙂

    #717
    David
    Participant

    Hi Tom, a very nice picture with your baby!

    I am using the Post Type Builder plugin.

    I read the link you send me support, but something I’m doing wrong because it does not work.

    Can you help me? Thank you

    #724
    Tom
    Keymaster

    Can you show me the code you’re using?

    #731
    David
    Participant

    Hi Tom, the code:

    [insert_php]
    add_action( ‘wpsp_before_title’,’wpsp_add_custom_meta’ );
    function wpsp_add_custom_meta()
    {
    $meta = get_post_meta( get_the_ID(), ‘ptb_module ptb_text ptb_text_1’, true );
    if ( isset( $meta ) && ” !== $meta )
    echo $meta;
    }
    [/insert_php]

    with plugin insert php.

    #733
    David
    Participant

    Hi Tom, I keep trying new things to make it work …

    I installed Pluginception and I created a plugin with the code:

    <?php
    / *
    Plugin Name: codigophpfechacurso
    Plugin URI:
    description:
    Version:
    Author:
    Author URI:
    License:
    License URI:
    * /
    add_action ('wpsp_before_title', 'wpsp_add_custom_meta');
    wpsp_add_custom_meta function ()
    {
         $ Meta = get_post_meta (get_the_ID (), 'ptb_module ptb_text ptb_text_1', true);
         if (isset ($ meta) && ''! == $ meta)
             echo $ goal;
    }
    ?>

    But it does not work. Maybe I have an error in the code?

    Thanks!

    #735
    Tom
    Keymaster

    This: wpsp_add_custom_meta function ()

    Should be: function wpsp_add_custom_meta()

    This doesn’t look right: ptb_module ptb_text ptb_text_1

    The value should be 1 unique ID.

    $goal isn’t defined anywhere, it would be echo $meta;

    You might want to check with the Post Type Builder plugin on how to retrieve the settings you’re creating.

    #1249
    Thierry
    Participant

    hello Tom,

    I understand but what is the code for display the field “Relationship” ?

    #1258
    Tom
    Keymaster

    Totally depends on how you set it up – the plugin you’re using to create custom fields should have examples of how to call them in your templates.

    #1261
    Thierry
    Participant

    no problem for display a simple field with your snippet but for a relationship with link i don’t understand for the moment. i search

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.