Jump to content


Photo
- - - - -

Code to 404 page


  • Please log in to reply
5 replies to this topic

#1 gwiley

gwiley

    Advanced Member

  • Members
  • 32 posts
  • LocationCalifornia
  • Framework Version:2.4.4
  • Country: Country Flag

Posted 20 June 2013 - 08:30 PM

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



#2 James B

James B

    Advocate

  • Moderators
  • 4978 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 20 June 2013 - 10:00 PM

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.



#3 gwiley

gwiley

    Advanced Member

  • Members
  • 32 posts
  • LocationCalifornia
  • Framework Version:2.4.4
  • Country: Country Flag

Posted 20 June 2013 - 10:47 PM

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



#4 James B

James B

    Advocate

  • Moderators
  • 4978 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 21 June 2013 - 12:37 AM

ah yeah the contentbox will only take html not php. 

 

To use php in a contentbox you'll need to use a plugin like

Please Login or Register to see this Hidden Content

 

or

 

a wordpress hook/filter.



#5 gwiley

gwiley

    Advanced Member

  • Members
  • 32 posts
  • LocationCalifornia
  • Framework Version:2.4.4
  • Country: Country Flag

Posted 21 June 2013 - 04:28 AM

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:

Please Login or Register to see this Hidden Content



#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 21 June 2013 - 11:59 AM

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