WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Add dynamic content under posts (3 posts)

  1. Marxman
    Member
    Posted 6 years ago #

    Hi,

    I an not a coder so I hope there is aplugin for this.

    I need a plugin where I can add dynamic HTML content in a post. The content should not be shown in the post on the frontpage, but only under the post while clicking it and entering the single page.

    I hope it is clear.

    Thanks!

  2. Kafkaesqui

    Posted 6 years ago #

    A combination of custom fields and the Single Post template should work for you here. References:

    http://codex.wordpress.org/Using_Custom_Fields
    http://codex.wordpress.org/Stepping_Into_Templates#Special_Template_Files

    A few plugins that may be of help here can be found:

    http://codex.wordpress.org/Plugins/Meta

    One to look at is Get Custom Field Values:

    http://wordpress.org/extend/plugins/get-custom-field-values

    There is also a template tag for displaying custom field keys and values in a post:

    http://codex.wordpress.org/Template_Tags/the_meta

    It may be a bit underpowered for what you want though, as there's no way to control the outout. A simple bit of code to accomplish a basic dump of a single custom field value is:

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

    That would work within The Loop (placed in your template) for a custom field with a key of 'html'. It displays nothing if no 'html' custom field key exists with the post.

  3. Marxman
    Member
    Posted 6 years ago #

    Ok thanks, gonna study this.

Topic Closed

This topic has been closed to new replies.

About this Topic