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");
Did you know?Explore Trending and Topic pages for more stories like this.
/*
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
37
Other forums
natcasesort works on one server but not on another
Hi
I have a problem that I was hoping that someone can help me with.
I'm trying to use
BackButton Behaviour in AJAX
I have an ASPX Page AJAX Enabled!The page has a gridView and a DDL for filtering on it. The Gridview
ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c
Writting a script to arrange images........ need some help
Ok so here is the link
http://hmtotc.com/dev/projects/vrassociates/jeweler_dev/admin/index.ph
ereg_replace in Wordpress
Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patients
The
Email to a friend script problems
I have this send-to-a-friend script with 2 issues:
1) When you open the form popup on a p
Deleting pointers froms vector?
Hi. I have a vector filled with pointers and I want to delete the pointers. I could do a loop and do
Having Problem with Date
l have a submit buttom where user have the possibility to add a date to specify when his message s
Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga
Simple image grab script.
I was wondering if it was possible and if anyone knew how to make a simple php script that looks at