1

I'm trying to enter a small piece of information that is created from a plugin to an area of my wordpress page that is called my a custom post.

The plugin that I'm using is FlippingBook WordPress Gallery Plugin (I have purchased a license)

After I create a book I put this code into my post: [book id='2' /] This works fine if I just place it in my post, but all of the other content of the page is entered via custom posts so this needs to be as well so it flows inline with the structure of the document.

So I am calling to enter this information like this:

        <div>
        <?php echo get_post_meta($post->ID, 'enter_page_flip_id', true); ?>
        </div>

But the [book id='2' /] no longer renders the book content, only text shows. Am I writing the custom post call incorrect?

The site: http://www.cicadabooks.co.uk/new/graphic-book-one/

Thanks much!

2 Answers 2

2

The Wordpress function to expand [shortcodes] into HTML is called do_shortcode. Try doing echo do_shortcode(get_post_meta(...)) and see if that helps.

Sign up to request clarification or add additional context in comments.

Comments

1

The problem is that printing values from get_post_meta is different from calling the_content or some other built-in for displaying a post body. Those functions look for registered filters on their content and run those filters, which is how a plugin can find its shortcodes like [book] to replace.

One thing you might do is read the source of this plugin, find the code that replaces the shortcodes, and call that yourself from your template.

1 Comment

All of the source code is somehow locked or jumbled so I can't view the php. Thanks for the suggestion though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.