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
Why use OOP?
Can someone explain to me why I should use OOP instead of procedure based code.
Im building a
displaying email without attracting a ton of spam
Hello,
this is maybe the wrong place to ask.
How would you display an email address on a w
Call db table from any PHP file
Hi,
I want to be able to call a database table that will be setup in another file called init
FTP Programs
Here is a list of commonly suggested FTP Programs to use:
FileZilla
SmartFTP
CuteFTP
mysq_num_rows
Hi,
I want to use:
Code: if(mysql_num_rows($ergebnis2)==2)
how can the value 2, be
Hi, explode and strstr.
Hi, I seem to be confused about the strstr function, eg. i have a string like:
"a.b.c.d.e.f&
Dynamic Array using glob?
Is there an easier way to do this?
I am trying to get create a dyamic array based on files wi
Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the
rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?
PHP Redirecting
Hello everyone. Is there a way to redirect people to pages within a statement in PHP? Since there is