Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Derek Herman

    (@valendesigns)

    How are you displaying the code you pulled from the post and does this actually have anything to do with OptionTree? Is the content saved into a meta box or the custom post type content editor?

    Thread Starter redgroup

    (@redgroup)

    Hi Derek,

    Sorry for the delay, only saw the reply now.

    The actual post is using shortcodes, two columns. What I am doing on this page https://www.blueginger.co.uk/pexa/brands/scapa/ is adding a meta on the post editor to select other posts to display below the main content (the actual products of the brand in question). To get the shortcodes to work in this I am using the following code:

    <?php
    // Get Selected Posts From Meta
    $my_id = get_post_meta($post->ID, 'product_posts', true);
    if ($my_id) {
    // Loop through each item in Array
    foreach ( $my_id as $custom_post_id ) {
        // Get post object for each selected ID
        $current_post = get_post( $custom_post_id );
    
        // Print it or what ever you want
        echo '<div class="storycontent">';
        echo '<h1><a href="'.get_post_permalink($current_post).'">'.( $current_post->post_title ).'</a></h1>';
        echo do_shortcode( $current_post->post_content );
        echo '<div class="clear"></div>';
        echo '</div>';
    }
    }
    ?>

    [Moderator Note: Please post code & markup between backticks (not single quotes) or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    Thread Starter redgroup

    (@redgroup)

    Just want to bump this one as I could really do with a reply. Looks like I didn’t post the code correctly either, adding it again to this post in case.

    <?php
    // Get Selected Posts From Meta
    $my_id = get_post_meta($post->ID, 'product_posts', true);
    if ($my_id) {
    // Loop through each item in Array
    foreach ( $my_id as $custom_post_id ) {
        // Get post object for each selected ID
        $current_post = get_post( $custom_post_id );
    
        // Print it or what ever you want
        echo '<div class="storycontent">';
        echo '<h1><a href="'.get_post_permalink($current_post).'">'.( $current_post->post_title ).'</a></h1>';
        echo do_shortcode( $current_post->post_content );
        echo '<div class="clear"></div>';
        echo '</div>';
    }
    }
    ?>

    I want to sell two premium wordpress plugin with 70% dscount….

    Thread Starter redgroup

    (@redgroup)

    Really? Spam from informerfrk? Is there is a sledgehammer I can knock you over the head with?

    Their are no url , so no spam I think…

    I want to sell two premium wordpress plugin with 70% dscount…. my email is [email protected]

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Post Checkbox stripping out html formatting’ is closed to new replies.