Forums » Customize

can u put php into index.php file

Si_guy
UK
2010-07-26 17:56:38
Permalink Post
 

can u put php into index.php file in the theme folder?

I tried this and the php doesn't get read. ???

I want to include a file by adding

no hope although the index.php file has a php extension it does not make sense.

Any help?

Vaska A
UNITED STATES
2010-07-26 19:05:27
Permalink Post
 

What?

hirshmon
UNITED STATES
2010-12-09 14:24:22
Permalink Post
 

He asked it in a pretty inarticulate way...but I'm having this problem, too, and I really need it resolved.

I am using the Sample theme (customized), and when I try to edit index.php by adding any php code (even a simple echo), it isn't parsing it at all. No output, nothing. When I put in buggy PHP code, it produces no errors, either. Why does index.PHP not process PHP?

If I want to add a PHP function that checks for the page's title and then uses the title to decide which image to output in the index.php file, where would I put that code?

Vaska A
UNITED STATES
2010-12-09 20:21:29
Permalink Post
 

Because, the parser doesn't parse PHP directly. You need to make a plugin...plugins use PHP.

If I want to add a PHP function that checks for the page's title and then uses the title to decide which image to output in the index.php file, where would I put that code.

On the tutorials page there is a very quick tutorial about making plugins. Also, you will want to note the system variables.

hirshmon
UNITED STATES
2010-12-10 10:48:46
Permalink Post
 

Ok...I know this is getting off topic, but could answer me one simple question:

If I'm calling this plugin in the content div, why is the output appearing at the very top of the page? How do I get the context to be correct?

hirshmon
UNITED STATES
2010-12-10 11:42:54
Permalink Post
 

Nevermind...I forgot to return, instead of echo.
sorry for the trouble and thanks for the help.

I'm guessing the guy who posted this topic also didn't realize things needed to be done as plugins.

There is a lot of stuff in the tutorials/documentation that needs to be clarified. They're not very helpful.

Showing 1 - 6 of 6 posts in Forum > Customize > can u put php into index.php file
 

You need to be logged in to post.