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:

<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

<?php if ($author=="admin"){echo "hello24241";} ?>

and edit here...

<?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: ?> [B]\* I get an error on this line *\[/B]
        <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

I apologize as soon as I sent this I remembered I started the thread in wrong are, not sure how to move this but if a mod could delete this ill make new post in php.

Thanks :$

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.