• I want to have a list of names (with email addresses) that can be used sitewide on a dynamic basis.

    For instance, wherever the organization’s Secretary (a changing position) is referenced, I want the latest name and email address automatically updated to that link. So if there is text to contact the Secretary, no matter where (or on how many pages) it occurs, the latest contact info will be there.

    I know I can do a manual site-wide find and replace every time a position changes, but why not a dynamic solution? Just change the data in the table and it shows up everywhere!

    I know how to do that on a non-WordPress site (have a table of names, titles, and emails and retrieve that data anywhere needed by doing a sql query and GET).

    But I don’t know how to do that in WordPress.

    Any suggestions? Plugins?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t know of any plugin, but it does not mean one does not exist. Your search skills are likely as good or better than mine.

    If all else fails, you could create a custom shortcode, for example [secretary]. Anywhere in any post or page content where this occurs, it could be replaced by the current secretary’s name and email or any other HTML you like.

    A shortcode causes arbitrary PHP to execute. The PHP could query a DB table to GET the current secretary’s data and use it to put together appropriate HTML.

Viewing 1 replies (of 1 total)
  • The topic ‘sitewide substitution of a name or email’ is closed to new replies.