WordPress.org

Ready to get started?Download WordPress

Forums

Need help, with theme options outside of wordpress (2 posts)

  1. spnweb
    Member
    Posted 1 year ago #

    Hello,

    I need some help/advise/support with using wordpress theme functions outside of wordpress. Basically I made a javascript widget that shows a countdown for upcoming episode and the problem is i have to edit that widget every week via ftp/etc. Is there any i can use a code like this

    <?php $episode_title2 = get_theme_option('episode_title2'); echo ($episode_title2); ?> inside a javscript file instead of changing it manually every week.

    what do i need to add to the javascript file to make that function work.

  2. bcworkz
    Member
    Posted 1 year ago #

    Your best bet may be to use jQuery to make an AJAX call to your WP server. You can filter AJAX requests within WP to respond to such requests with the appropriate data. jQuery can then place such a response inside the appropriate HTML element. See AJAX in Plugins.

Topic Closed

This topic has been closed to new replies.

About this Topic