WordPress.org

Ready to get started?Download WordPress

Forums

Custom Code (3 posts)

  1. theshadraq
    Member
    Posted 1 year ago #

    I recently took on a project for a small non-profit to give them some functionality in their website. I've done a lot of PHP/JQUERY/AJAX and the lot, but nothing in WordPress. Needless to say I'm a bit stumped.

    There wasn't a plugin that I could find that did what this group needed, so I built custom functionality. test.somesite.com/thenewfunctionality.

    My question is this - what do I include so that my code shows inside the header / footer / sidebar(s) as though it's part of the site.

    I assume getting it to upgrade with the site when changing themes is alltogether different..for this, I'm just looking for it to look cohesive now.

    Thanks,
    Shadraq

  2. michael.mariart
    Member
    Posted 1 year ago #

    I'd suggest that you look at putting your code inside a plugin so that it can be easily moved around, and you don't have to worry about any upgrades.

    http://codex.wordpress.org/Plugin_API

    As for putting them into your theme, it's easy. You just need to call your functions from your templates. If you want to use it in posts, you can look at Shortcodes and if you want to add it to sidebars, you can look at Widgets.

  3. theshadraq
    Member
    Posted 1 year ago #

    I've written a lot of custom Javascript too so I'll have to see about the plugins that add my code to the site.

    Thanks, I'll give it a go (the site you mentioned) and let you know if I have any questions.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags