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

Running a cron job through PHP/Apache?!
Hello all,
I have a PHP script which makes a cron file from user input. When i try to run the cro

Echo Tweaking help!
HI. I would like to have the output of the entered variables repeat forever, but it's stopping at th

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

Calculus Help (and by help I mean homework)
Hrmmm, I hate posting about math homework, partly because it's homework, and partly because I hate w

Select all entries from database that include a phrase
I have a database of clubs - one of the categories is meeting time and place
I would like to have

Multiple forms on the same page (safari)
Hello everyone,

I have 3 forms on the same page, that opens in a new window and submits to a

How to create a static html menu from a database
Hi,

I have built a small cms which allows me to create simple html pages and then upload them

Object Interfaces
EDIT: Never mind, I just updated to php 5.

Hey all,

I'm currently experimenting with p

Need PHP help... have all the elements... just need help putting them together :
Hey Guys,

I was wondering if someone could help me. I am doing a website for a client which

SAP Management Console is blank
Dear All ,

I am facing problem in my des sever suddely in SAP Management Console is blank 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