carlos123
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: Why does PHP call to the_category() do this?I think it might be a PHP thing not a WP at all.
PHP might evaluate and call functions in the code first before evaluating the code around a function and executing it which might explain why concatenating the_category() to a string doesn’t work as expected.
What the_category() spits out on it’s own gets output before the string I am concatenating it to.
Hmmm…
Carlos
Forum: Everything else WordPress
In reply to: Why does PHP call to the_category() do this?It does appear that WP is doing something strange with the return values of functions like the_category().
If I assign the return value to a variable and then echo it…the output is likewise messed up.
If I do an “echo the_category(‘, ‘);” no problem. Weird.
I sure hope WP does not do any pre-processing because that’s going to throw a real kink in my efforts to use WP as a CMS.
Anybody?
Hmm…maybe the_category() doesn’t return anything and instead prints out something to the screen. Hmm…that might be it.
“echo the_category()” might work and spit out the correct thing to the screen because it’s in the right place in the code (essentially the echo part is ignored). Whereas if I move it elsewhere it spits out it’s thing there instead. Hmm…I think that might be it.
Carlos