0

I used this to obtain my post:

$the_slug = 'kontakt';
$args=array(
    'name'           => $the_slug,
    'post_type'      => 'post',
    'post_status'    => 'publish',
    'posts_per_page' => 1,
    'suppress_filters' => false
);
$my_posts = get_posts( $args );

The resulting post is:

enter image description here

but the text still contains the plugins shortcode

[wpgmza id="1"]

I used the plugin

https://wordpress.org/plugins/wp-google-maps

Am I using a way of parsing for the post that somehow stops the plugin from working?

Should I not use the text editor to add the shortcode?

2

Shortcodes get replaced when you output the content via the_content() function, or apply the filters hooked to the_content. If you look at raw post data, you will always see the original shortcode placeholder, that is normal and expected.

1
  • thanks for the hint. The solution is btw <?php echo apply_filters('the_content', $my_posts[0]->post_content); ?> – Toskan Feb 23 '15 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.