WordPress.org

Ready to get started?Download WordPress

Forums

Adding a PHP content variable from the WYSIWYG editor? (2 posts)

  1. bennywp
    Member
    Posted 1 year ago #

    Hi everyone,

    I was wondering if it was possible for a WordPress back end user to input some sort of basic content within a WYSIWYG editor when editing pages that could be used within the page template in a predefined section that is separate from the main page content (almost like a sub-page, but not quite what I need).

    For example, say I have a page with some content, and the user puts in a smart code (eg. [miscinfo]test[/miscinfo]). In the PHP files, whatever HTML is inserted between those tags is saved in a PHP variable that can be used in a separate DIV that is completely removed from the main page content.

    Is this possible? Any help would be appreciated, thanks.

  2. wpismypuppet
    Member
    Posted 1 year ago #

    You are looking to either use a custom field:

    http://codex.wordpress.org/Custom_Fields

    Or you are looking for creating your own shortcodes:

    http://wp.tutsplus.com/tutorials/theme-development/wordpress-shortcodes-the-right-way/

    Not sure which would be easier/best in your case, but since you mentioned shortcode tags in your post, I'm guessing that's the way you want to start.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.