WordPress.org

Ready to get started?Download WordPress

Forums

How to Store text and HTML Code so as to Re-use in Post (7 posts)

  1. Blurazor
    Member
    Posted 2 years ago #

    Hi,

    I have a piece of text and HTML Code that I repeatedly use in almost every post. I would like to store it at a central location and refer to it much like a shortcode. That is, in a post, I may include something like [mycode] and the associated piece of text and HTML code would be automatically displayed within that post.

    This is so that when there is a need to make any amendment to the code, all previous posts that refer to it will be updated with the change.

    May I know how that can be done?

    Thanks,
    Blurazor

  2. keesiemeijer
    moderator
    Posted 2 years ago #

  3. Blurazor
    Member
    Posted 2 years ago #

    Thanks for the prompt reply keesiemeijer.

    Is there any other ways to achieve the same result besides using shortcode. I was merely using shortcode as an illustration. :-)

  4. keesiemeijer
    moderator
    Posted 2 years ago #

    Why not use a shortcode?

  5. Blurazor
    Member
    Posted 2 years ago #

    I'm not at all familiar with shortcut (except using a couple of them provided by some plugins).

    I anticipate another requirement is the need to be able to display slightly different text+HTML for different user (I am guessing I can use attributes.)

    Would shortcode be able to fulfill these requirements?

    Thanks.

  6. keesiemeijer
    moderator
    Posted 2 years ago #

    I am guessing I can use attributes.

    yes.

    What is the html you want to use?

  7. Blurazor
    Member
    Posted 2 years ago #

    The html I'm using are links to an image file and to a few links to my webpages.

    The only change in the foreseeable future is the address to the image file, that is, instead of src="http://www.homepage.com/wp-content/uploads/2012/02/image_01.jpg", I would need to reference image_02, image_03 etc.

    Is using attributes feasible? Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.