Support » Fixing WordPress » 404 pages and variables

  • Resolved CSD-Images

    (@csd-images)



    WordPress 3.03. I’m doing a custom theme which has a featured image on each page. The featured is a custom field type set for each page. This function works for every page bar the 404. Which throws up:

    Undefined variable: featured_image

    So I’m kind of curious why is this only happening on the 404 page and not any other of the pages?

    This is the code:

    http://wordpress.pastebin.com/CeM7RXPr

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, the 404 Error Pages don’t have any posts assigned to them and by my understanding they won’t utilize the standard for wordpress loop. You should have a separate page template for 404 pages and can simply include the default image you want in it.

    Cheers that’s what I suspected, so I’ll modify the theme template call with !=404 statement. I really don’t want to create a single page as I’m trying to reduce the clutter of files!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘404 pages and variables’ is closed to new replies.