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

2 decima places & How to reload my page
Hello There,

How do i put full-stop (.) after second figure from behind? ie if i have 123456

Track downloads' status
Hello,

I need to make somehow, some system, to track whether downloads are completed or faile

Can anyone give me some link on .htaccess tutorial
i wish to have friendly url using .htaccess, but no idea yet about this

Hope that anyone cou

A WBS element with the name XXX already exists in version FREI_VERSION
Hi.
When I am trying to insert WBS element in a project, error occurs:

"A WBS eleme

Combining Two Queries
I have two scripts that each work fine by themselves. One is a search script with a variable that de

Trigger tag in aspx is not coming
hi all ,iam new to ajax, iam using file upload inside the update pannel but right now i want to use

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Aris, Netweaver BPM, Visual composer and X'app
Dear Experts,

Whats the relationship between the following components: Aris, Netweaver BP

Undefined offset when using a flat file with pipe symbols
Hi, I've got a flat file/text file which I'm currently using as a member database for my site (not a

Please help - should be a simple fix.. driving me nuts
Everything seemed to be working fine. I have a table, it alphabetically lists a bunch of cities and

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