Title: Custom Code in Custom Page
Last modified: August 20, 2016

---

# Custom Code in Custom Page

 *  [yeagerc50](https://wordpress.org/support/users/yeagerc50/)
 * (@yeagerc50)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/)
 * I have a simple script that displays each row of data in a block of html. Works
   fine in my editor but when I call it in my custom page it “skips” the first row
   of data (displays the back ground image but no data) and at the end (of course)
   it skips the back ground image and displays the data.
    ‘<?php
 * /**
    * Template Name: Custom Template * Description: A Page for Custom Coding*/
   get_header(); include(“display_cars1.php”); get_sidebar(); get_footer(); ?>’
 * Would appreciate any help.

Viewing 14 replies - 1 through 14 (of 14 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2853920)
 * The interesting code is in display_cars1.php. Why didn’t you post that( to the
   [pastebin](http://pastebin.com/))?
 * Also, you should be using [get_template_part](http://codex.wordpress.org/Function_Reference/get_template_part).
 *  Thread Starter [yeagerc50](https://wordpress.org/support/users/yeagerc50/)
 * (@yeagerc50)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2853974)
 * [http://pastebin.com/embed.php?i=SrQQwfLV](http://pastebin.com/embed.php?i=SrQQwfLV)
 * First time with this so don’t laugh too loud 🙂
 *  Thread Starter [yeagerc50](https://wordpress.org/support/users/yeagerc50/)
 * (@yeagerc50)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2853985)
 * I forgot to mention I’m running this in the core template folder of twentyten.
   I haven’t created a child theme.
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854004)
 * The url you wanted was this one:
 * [http://pastebin.com/SrQQwfLV](http://pastebin.com/SrQQwfLV)
 * 🙂 🙂
 * That is an odd animal you have there.
 * You are echoing a doctype, html, head, and body tags– multiple times– inside 
   the ones that WordPress echoes. Those should be one per page.
 * You’ve got multiple duplicate id elements.
 * Font tags are deprecated.
 * I assume the img on line 25 is what you are calling a ‘background’ image. I don’t
   see any reason that shouldn’t work (in broad strokes) but I don’t know what $
   row looks like either.
 *  Thread Starter [yeagerc50](https://wordpress.org/support/users/yeagerc50/)
 * (@yeagerc50)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854035)
 * [http://s245.photobucket.com/albums/gg52/JHCORSAIR/Screenshots/](http://s245.photobucket.com/albums/gg52/JHCORSAIR/Screenshots/)
 * Just wanted to show you what it looks like when it displays properly.
 * The worst part …..not sure what I did to fix it.
 * Typical php newbie 🙂
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854066)
 * Do you have a URL that I can get to?
 *  Thread Starter [yeagerc50](https://wordpress.org/support/users/yeagerc50/)
 * (@yeagerc50)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854136)
 * I’ll get it up on my site and get back to you.
 * joomlawebsitesbyjim.com/
 * Click the My WordPress Blog tab.
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854148)
 * You have an error even before the loop starts.
 *  Thread Starter [yeagerc50](https://wordpress.org/support/users/yeagerc50/)
 * (@yeagerc50)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854163)
 * [http://www.joomlawebsitesbyjim.com/wordpress/custom-page/](http://www.joomlawebsitesbyjim.com/wordpress/custom-page/)
 * Ok.. it’s running. Just messing with the css bugs for now and I’ll get the images
   later. I made a few corrections.
 * I think I jumped the gun. It’s not grabbing all the rows ……it’s a wip.
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854171)
 * You should revisit my earlier post. You have a [pile of errors](http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.joomlawebsitesbyjim.com%2Fwordpress%2Fcustom-page%2F)
   on that page, as I knew you would.
 *  [ehoanshelt](https://wordpress.org/support/users/ehoanshelt/)
 * (@ehoanshelt)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854172)
 * Hey yeagerc50,
 * I think your over thinking this. Your using WordPress so alot of this code is
   unnecessary if you use the right WordPress functions.
 * For example, check out this page to run custom queries:
    [http://codex.wordpress.org/Class_Reference/wpdb#SELECT_Generic_Results](http://codex.wordpress.org/Class_Reference/wpdb#SELECT_Generic_Results)
 * Here is a very basic example of how this custom code template should look like(
   it’s 1 in the morning here so use this as reference, NOT WORKING EXAMPLE):
 * [http://pastebin.com/Jua9Qsyp](http://pastebin.com/Jua9Qsyp)
 * That shouldget you on the right path. One thing to notic is I’m not including
   any <head> information. This is being taken care of by the get_header() which
   pulls in header.php.
 * Let me know if that all makes sense 🙂
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854175)
 * Also have a look at custom post types, _**this is an ideal candidate for custom
   post types**_, there are a number of plugins for custom post types, [this plugin](http://wordpress.org/extend/plugins/custom-content-type-manager/)
   looks like it will do all you want “out the box”, it is recently updated.
 * That way you are not adding tables to the database and all the WordPress API 
   functions are there to be used.
 * Regards
 * David
 *  Thread Starter [yeagerc50](https://wordpress.org/support/users/yeagerc50/)
 * (@yeagerc50)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854184)
 * Thanks for all of your comments guys. Looks like I’ve got some learning to do
   for sure. Firstly, I think I need a better understanding of how WordPress works.
   Can anyone recommend a good book that covers the basics and advanced stuff?
    
   Yeah, I know ……. the question has been asked a million times but I’d much rather
   get feedback from the people that have “been there done that” so I can get straight
   to the good stuff.
 *  [ehoanshelt](https://wordpress.org/support/users/ehoanshelt/)
 * (@ehoanshelt)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854187)
 * I would look at codex.WordPress.org. It’s free and written by the community.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Custom Code in Custom Page’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 14 replies
 * 4 participants
 * Last reply from: [ehoanshelt](https://wordpress.org/support/users/ehoanshelt/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/custom-code-in-custom-page/#post-2854187)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
