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

Help with syntax
Hi all!

The $bridge variable is not getting passed while it is contained in the line below:

Apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

How do I use a global footer..?
If my index.php has a bole bunch of if functions and exit's in them

Two warning messages
Quote<b>Warning</b>: mysql_real_escape_string() expects parameter 1 to

Searching keywords from array
Hello everyone, Im just wondering if someone could help me with another issue im having. Im still le

shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just

Adding post count
How would I make it so everytime someone clicks submit on my form, their row in the database for the

Referential Integrity problem when inserting into 2 tables at same time
Hello Everyone,

Im relativity new to PHP and MySQL and i have come up against a problem. i h

Hyperlink is adding an extra gap to variable
Hi, here's my problem..

I have a php generated page with a hyperlink which opens in a new win

Find only certain URLs from page ... regex (semi-complete script)
Hi guys,

What I need to do is take a page & extract all the URLs from the page &a

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