fterh
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: WordPress global variablesMm so you mean normally the functions file has a set of functions, and theme designers only call those functions when needed?
Forum: Fixing WordPress
In reply to: WordPress global variablesI printed them out but the list was very short.
Wait, I printed it on another php file – maybe that’s why. Yep, it worked when I used it inside the loop.
Last question. I noticed my functions.php file is totally redundant. I deleted everything and saved, and my page looks perfectly fine. I pasted back everything and refreshed, and there is no change.
So should I just remove everything inside functions.php file and make my own function (one only)?
Forum: Fixing WordPress
In reply to: WordPress global variablesI tried using the print_r function, I realised that $comment is not a global variable but $comments is. Also they have to be in the loop (I think) because I made a new php file in the same directory with the code:
<?php print_r($comments); ?>
which doesn’t work.
Are my deductions correct about $comments and not $comment being the global variable and they have to be in the loop?
Edit: Also how do you use for foreach loop to display x number of comments on each comments page, where x is the number defined under Settings>Discussion
Forum: Fixing WordPress
In reply to: WordPress global variablesThanks for the speedy reply. Here’s another question.
I want to make my own comments structure like <author>, on <date & time> says:
I know I have to use the foreach statement:
<?php foreach($comments as $comment) : ?>
which works perfectly but I’m just curious: In the link you sent me, $comment is a global variable but $comments is not. However in the PHP foreach statement if I replace $comment with $comment2 it works fine, but not if I replace $comments with $comments2.So I’m just kind of confused as to which is the real global variable.
Forum: Themes and Templates
In reply to: Creating the comments templateBump