| | |
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 |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxexample ajaxjspservlets array beta browser captcha captchaformproblem cart child close codes column css date debugger decimal dependent design developer disablefirebug dom download element embed engine enter error events ext file firefox focus form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html ie7 ie8 iframe index java javascript javascripthelp2020 jquery jsp jump libcurl listbox maps marquee masterpage math media menu mp4 onerror onmouseoutdivproblem onmouseover onreadystatechange paypal pdf php position post problem programming prototype rated rating redirect safari scale scriptlets scroll search security select software star starrating synchronous toggle tweet unicode variables w3c web webservice window windowofwords \n





