php include returns 1 as output with other outputs [closed]

First of all, this is not WordPress-specific, and does therefore not belong in WordPress.StackExchange. As it’s so easy to answer, however… include is not a function, but it does return whatever you put in “return” inside the file that’s included. You can use an output buffer to “catch” all output: ob_start(); include TEMPLATEPATH . ‘/apex.php’; … Read more

How to define category ID in an array?

As Geert pointed out, your current conditional will always be true. An if() construct needs to be fed an expression. You’re feeding it a valid array, so that’s true. Always. So far this is basic PHP, regardless of whether in a WP environment or not. As can be read in Chris_O’s comment if ( is_category(‘some-cat’) … Read more

Javascript file not included only on home page

This might be because of two issues: Unique handler is not used to enqueue scripts on homepage Path to the file is wrong Unique Handler You should use unique script handler while enqueuing scripts or styles using wp_enqueue_*, I see that you used script as your script handler which is pretty generic and is not … Read more