| | |
php within echo statement / hide element
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2009
Posts: 20
Reputation:
Solved Threads: 0
hi all,
I am wondering if someone could give me a quick hand with some php im trying to edit in Wordpress.
Heres the original peice I am trying to edit:
What I want to do is when "the_author" equals "admin" for the div to be hidden or deleted.
I have added this to make sure that it can find admin
and edit here...
My question I guess would be is there a statement that would be able to hide/delete the div? Or should I be re-writing this code, like this...
Thanks for any help,
and if you need me to be a little more clear just ask,
tian
I am wondering if someone could give me a quick hand with some php im trying to edit in Wordpress.
Heres the original peice I am trying to edit:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<div class='dateauthor'> <small class='capsule'><?php the_time('F jS, Y') ?> by <?php the_author() ?> </small> </div>
What I want to do is when "the_author" equals "admin" for the div to be hidden or deleted.
I have added this to make sure that it can find admin
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<?php if ($author=="admin"){echo "hello24241";} ?>
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<?php $author=the_author() ?>
My question I guess would be is there a statement that would be able to hide/delete the div? Or should I be re-writing this code, like this...
<?php $author = the_author(); ?>
<?PHP if ($author=="admin")?> working
<?php else: ?> \* I get an error on this line *\
<div class='dateauthor'>
<small class='capsule'><?php the_time('F jS, Y') ?> by <?php the_author() ?>
</small>
</div>
<?php endif; ?>Thanks for any help,
and if you need me to be a little more clear just ask,
tian
•
•
Join Date: Jun 2008
Posts: 8
Reputation:
Solved Threads: 0
You are getting an error in the else line because
you are trying to use VB type if else in PHP.
But PHP is originally based on C language so that
if else will surely return an error
to learn more about the if else statement in PHP
Follow this link: http://www.w3schools.com/php/php_if_else.asp
you are trying to use VB type if else in PHP.
But PHP is originally based on C language so that
if else will surely return an error
to learn more about the if else statement in PHP
Follow this link: http://www.w3schools.com/php/php_if_else.asp
![]() |
Similar Threads
- passing parameters in ajax through php echo command (JavaScript / DHTML / AJAX)
- echo statement in form (PHP)
- echo statement (PHP)
- HTML codes in PHP (PHP)
- PHP - sending data via hyperlink (PHP)
- show/hide element by name (JavaScript / DHTML / AJAX)
- mysql_fetch_array problem (PHP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Get the Height of Available Window Space with Javascript
- Next Thread: prevent user from going back or disable submit
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser captchaformproblem cart checkbox child close codes css debugger decimal dependent disablefirebug dom download editor element engine enter error events explorer ext file firefox form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp jump listbox maps masterpage math media menu microsoft mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php player position problem programming prototype redirect regex runtime safari scale scriptlets search security select shopping size software sql textarea unicode w3c window windowofwords wysiwyg \n





