How to add php code to a 'single' page
Howdy,
I am hacking a plugin to fit in with my Atahualpa theme. It requires me to add some PHP code to the 'single posts' page...most other themes have a simple 'single.php' file, however I'm not sure this is the case with Atahualpa is it? Where abouts would I slot in this PHP code so that it only appears on the single post pages? |
in the "center column---> inside the loop" with a conditional statement like
Code:
<?php if is_single() AND "then add the rest of your php code"> |
Sorry to ask a really basic question....but I don't know how the IF statements work in PHP.
This is the PHP code I want to insert.... PHP Code:
|
try this
HTML Code:
<?php if is_single() { |
Quote:
Parse error: syntax error, unexpected T_STRING, expecting '(' in /home/jake13/public_html/shackn/wp-content/themes/atahualpa/functions.php(389) : eval()'d code on line 22 Any ideas why? |
try putting a () around the 'is_single()' so it would be 'if (is_single() )'
|
Thanks, I tried what you said, and now I get another error :)
Fatal error: Call to undefined function get_the_categories() in /home/jake13/public_html/shackn/wp-content/themes/atahualpa/functions.php(389) : eval()'d code on line 23 |
well that is from your original code you wanted to insert. That error says that the function 'get_the_categories()' doesn't exist.
Where did you get this code from? if it is a plugin, it should have had that function in it. If you were doing this properly, the code snippet should test to see if the function exists then display a notice on the page to that effect. But you need to go back and look at the original plugin, you are missing something |
Ok, cool, thanks for the advice, I'll speak to the plugin creator and report back with my findings :)
|
All times are GMT -6. The time now is 01:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.