Php WordPress help


Posted on 16th Feb 2014 07:03 pm by admin

I am writing the following code for making a plugin

<?php
header("Content-Type: text/css");
/*
Plugin Name: Name of the plugin.
Plugin URI: The page having information related to plugin.
Version: 0.1
Description: Your plugin description.
Author: Your name
Author URI: Author's website.
*/
?>
<?php
function box()
{
?><div class="box">
<p><b>Author:</b> <?php the_author_link(); ?><p>
<?php echo get_avatar( get_the_author_email(), '50' ); ?>
<p><?php the_author_description(); ?></p>
</div>
<?php
}
function style() {
echo "
<style>
<!--
.avatar{
float:left;
background-color: #fff;
border:1px solid #ccc;
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}
.box{
color: #666;
font-weight: normal;
background: #fff;
border: 1px solid #ccc;
padding: 12px;
margin-bottom:8px;
}
-->
</style>
";
}
function author_box_ContentFilter($content)
{
if (is_single())
return $content.box().style();
else
return $content;
}

add_filter('the_content', 'author_box_ContentFilter');
?>

This code is appending the author info box at the start of post.But i want to add the box a the end of post.I also tried
{
if (is_single())
return box().$content.style();
else
return $content;
}

But this is also not working.
Seeking for help to append the box at the end of post.
Thanks in anticipation

No comments posted yet

Your Answer:

Login to answer
127 Like 37 Dislike
Previous forums Next forums
Other forums

standard ALV application toolbar, into custom report....
HI,

I have a question regarding displaying standard ALV menu path and application toolbar

need help modifying script
Hi guys,

I'm fairly new to php and am having a bit of trouble modifying a script.

This

User feedback after MySQL query has been executed
Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out b

ereg_replace issue
hi there people

i have this code happening with regards to my wamp server. is this something

how can i make a .gif images for my site
Dear Friends ,

Pls solve my problem , I am starting making new site but i dont know how can i

Is it possible to stop reservation creation in PM Order?
Hi All,

Is it possible to stop reservation creation in PM Order?

Thanks in adv

LinkedList help
Ok so I just learned quickly about lists, so I have a not too hard project I think, but am having a

Warning: mysql_num_rows() expects parameter 1
When i add quote at the end of this link
example:http://localhost/articlemania/category.php?cid=3

BIG file upload!
Hey guys!

I'm trying to upload a file, it works well with smaller files but with 60mb+, I get

Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash