Archived

This topic is now archived and is closed to further replies.

  • 0

Code to 404 page

Question

Posted · Report post

I need to add a snippet of code to the 404 page.  Where is the best place to add it?  I don't want the code 'Global', only run on the 404 page.

 

Thanks in advance!

-gw

Share this post


Link to post
Share on other sites

5 answers to this question

Posted · Report post

I was just about to suggest Shortcode Exec PHP.  That's the standard and best one to use.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there

 

Add a contentbox (free section you can download from the pagelines store) and add it into the drag and drop template for the 404 page. You can then add the required code into Pagelines>page options>404 so it only affects the 404 page.

Share this post


Link to post
Share on other sites

Posted · Report post

Hmmmm, must not work if the snippet of code is PHP? :startle:

Share this post


Link to post
Share on other sites

Posted · Report post

ah yeah the contentbox will only take html not php. 

 

To use php in a contentbox you'll need to use a plugin like http://wordpress.org/plugins/exec-php/

 

or

 

a wordpress hook/filter.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks.  FYI, the plugin above won't work on the 404 page, or it may be the version of wordpress I'm using (3.5.1).  However, this plugin does work perfectly: http://wordpress.org/plugins/shortcode-exec-php/

Share this post


Link to post
Share on other sites