Call   0208 3131682   Mon-Fri 9am-6pm
Category

HTML

How to add a form to a shortcode in WordPress (using PHP and Ajax)

By | Ajax, HTML, Javascript, online forms, Wordpress | No Comments

Recently I needed to develop a Shortcode that would display a form, this blog post details what I did. I used Ajax ( which seems the best way to add forms to shortcodes, but I’d welcome any input from other developers on your approach).

So without further ado lets get on with adding a form to a shortcode in WordPress.

We need javascript to handle submission of the form via ajax (this presumes you have jquery available), and handle the response from the server. green_form is the form id.

 

Next we need the php to handle everything else, you could put this in functions.php (or include from functions.php) or put it into a plugin. The shortcode to include the form in our page or post is [shortcode_with_form] 

The code handles:

  • the output of the shortcode
  • the server side processing of the form (I’ve just created a stub in this example ( function do_something_serverside )
  • and the including of javascript file required ( if you’d like to know abit depth on ajax forms in WordPress see my post on that )
 

Hope you find this interesting if you’re looking to add a form to a shortcode.

 

 

 

Disclaimer: All content on this site, is use at your own risk (Always backup before changing anything in your software/database/servers etc). Techs change, go out of date etc...
I/we accept no liability if anything you use on this site adversely affects you.
Screen Shot of portfolio section

Create a portfolio section on WordPress website using Custom Post Type (CPT)

By | CSS, Freelance, HTML, PHP, Wordpress | No Comments

I’m going to show you how to create a portfolio section on your WordPress website.

For any many companies (such as web design agencies) and freelancers that work with digital media its important to have a portfolio section on your WordPress website.

I’ll show you how todo this using WordPress Custom Post Types, you’ll easily be able to update the portfolio via the WordPress admin interface without having to write extra html or css.

As I’m a WordPress Developer my portfolio section will focus on showcasing WordPress programming and web design. See  the finished version here.

Read More

Disclaimer: All content on this site, is use at your own risk (Always backup before changing anything in your software/database/servers etc). Techs change, go out of date etc...
I/we accept no liability if anything you use on this site adversely affects you.
Stop Wordpress caching files

3 Ways to easily stop wordpress caching your stylesheets

By | Caching, CSS, HTML, Theming, Web Design, Wordpress | 5 Comments

In this post I’m going to tell you how to easily stop WordPress from caching your css styles, so changes you make are instant. It can be very handy todo this while you are testing your new website. Read More

Disclaimer: All content on this site, is use at your own risk (Always backup before changing anything in your software/database/servers etc). Techs change, go out of date etc...
I/we accept no liability if anything you use on this site adversely affects you.

How to do Columns in HTML and CSS

By | CSS, HTML, Responsive Web Design, Web Design | No Comments

Recently my mate Dave asked me how to do Responsive columns in html and css using Divs.

Dave was used to doing columns in frameworks like the Twitter Bootstrap framework. I must admit I was abit rustly myself so I wrote this for myself as much as Dave. Read More

Disclaimer: All content on this site, is use at your own risk (Always backup before changing anything in your software/database/servers etc). Techs change, go out of date etc...
I/we accept no liability if anything you use on this site adversely affects you.