Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter intwine

    (@intwine)

    It works!!! Thank you so much!!! ??

    Thread Starter intwine

    (@intwine)

    Actually I thought of that too and tried that, it didn’t work. It only display the shortcode, not the form.

    Forum: Plugins
    In reply to: [CMB2] URL link not working
    Thread Starter intwine

    (@intwine)

    Hi Michael,

    I was just trying to pass the $url variable through href and you are right, it has got to do with the href attribute. I thought it was a CMB2 issue, I am sorry to have raised it here. But anyway, it is a syntax issue on how php encode html , and by adding href=”‘. $url . ‘”, I was able to get it to work.

    Thank you for pointing me to the right direction!

    Thread Starter intwine

    (@intwine)

    Hi Michael,

    I did try all the options available from CMB2 but none of them worked. But, you are probably right. I looked a little bit into gravity form, and they did say that “the “Add Form” button will only be displayed on the default Post or Page edit screens.”
    https://www.gravityhelp.com/documentation/article/gform_display_add_form_button/

    I would have to study that a little further to see how to implement.Thank you for all your input!

    Thread Starter intwine

    (@intwine)

    Hi Michael,

    Yes, I’d like to have the tinyMCE button for gravity form, is that possible?

    And thank you for your help with displaying the option fields, it worked great!

    Thread Starter intwine

    (@intwine)

    Michael, I successfully added the site options to my cpt archive, yay! It was not hard like you’ve said, thanks for your help! But I have a question, when I set my own CMB2 fields, am I suppose to change the ‘myprefix’ to something? I left it as it is, and it still works, but just want to do it right.

    So my next question is, I added a WYSIWYG to it, expecting it to show up like the default WP editor so that I may add a Gravity Form for the front-end. Well, that option wasn’t available. I know I could probably use CMB2 to add all the form fields, but I am afraid I can’t handle the complexity. Any suggestions on how to go about this?

    Also, I am yet to figure out how to display all of that new fields front-end. I did use CMB2 for another CPT and was able to display all the fields front-end. Are the steps similar?

    Thank you again for all your help!!

    Thread Starter intwine

    (@intwine)

    Thank you for the explanation, Michael! I was just really intimidated by the snippet and didn’t know where to begin! But your note is really helpful, and I am going to attempt it. I will update with results/questions! ??

    Thread Starter intwine

    (@intwine)

    Thank you for responding to my request, Justin! However being self-taught and quite a newbie at WP theming, this is probably a little too complex for me to implement and understand without any documentation. Where do I put the snippet?

    Thread Starter intwine

    (@intwine)

    Thanks Michael, I’ll just keep it simple by just prefixing them. ??

    Thread Starter intwine

    (@intwine)

    Here you go: https://pastebin.com/6ZdYyA1x

    Thank you!!!

    Thread Starter intwine

    (@intwine)

    Sorry, the code didn’t display properly, here’s the code in pastebin:

    https://pastebin.com/ibCRfAVz

    Thread Starter intwine

    (@intwine)

    Thank you for your reply, Michael. I am kind of a beginner at this, so I am not sure what’s the best practice when comes to this. I guess I could just echo the corresponding field name/key before each values, but I want to know the right way to do it.

    So below is what I did to display the “values”. I am by no means a programmer, and this is the first time I did all these. It took me a lot of trial and error to get me there, and everything is displaying correctly, so I am assuming I did it right? But what I am missing is the field key. For example, do I just echo ‘Population:’ to have the word ‘Population:’ before the population value? I can follow the logic of PHP if it is not too complex, I just want to do it the right way. If you can guide me towards the right direction, I’d really appreciate it! ??

    echo ‘<section class=”country-profile”>’;

    $entries = get_post_meta( get_the_ID(), ‘country_profile’, true );

    foreach ( (array) $entries as $key => $entry ) {

    $img = $population = $religion = $evangelical = $footnote = $country_profile_summary = ”;

    if ( isset( $entry[‘image_id’] ) ) {
    $img = wp_get_attachment_image( $entry[‘image_id’], ‘share-pick’, null, array(
    ‘class’ => ‘thumb’,
    ) );
    }

    if ( isset( $entry[‘population’] ) )
    $population = esc_html( $entry[‘population’] );

    if ( isset( $entry[‘religion’] ) ) {

    $religions = $entry[‘religion’];

    foreach ( (array) $religions as $key => $religion ) {
    echo ‘

      ‘;
      echo ‘

    • ‘ . $religion . ‘
    • ‘;
      echo ‘

    ‘;
    }
    };

    if ( isset( $entry[‘evangelical’] ) )
    $evangelical = esc_html( $entry[‘evangelical’] );

    if ( isset( $entry[‘footnote’] ) )
    $footnote = esc_html( $entry[‘footnote’] );

    if ( isset( $entry[‘country_profile_summary’] ) )
    $country_profile_summary = wpautop( $entry[‘country_profile_summary’] );

    echo $img;
    echo $population;
    echo $evangelical;
    echo ‘<span class=”foot-note”>’ . $footnote . ‘</span>’;
    echo $country_profile_summary;

    };

    echo ‘</section>’;
    echo ‘<section class=”tc-profile”>’;

    $name = get_post_meta( get_the_ID(), ‘_school_name’, true );
    $url = get_post_meta( get_the_ID(), ‘_school_url’, true );
    $since = get_post_meta( get_the_ID(), ‘_school_since’, true );
    $programs = get_post_meta( get_the_ID(), ‘_school_program’, true);
    $tc_profile = get_post_meta( get_the_ID(), ‘_school_tc_profile’, true);

    echo esc_html( $name ) . ‘</br>’;
    echo “” . esc_url( $url ) . ‘</br>’;
    echo $since;
    foreach ( (array) $programs as $key => $program ) {
    echo ‘

      ‘;
      echo ‘

    • ‘ . $program . ‘
    • ‘;
      echo ‘

    ‘;
    };
    echo wpautop( $tc_profile );

    echo ‘</section>’;

Viewing 12 replies - 1 through 12 (of 12 total)