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 37
Other forums MYSQL INSERT ID NOT WORKING Code: $id = mysql_insert_id(); header("Location: ./?view=$id"); Why $id pulling blan
Sort a two dimensional array. Hi. I've set up a two dimensional array that reads as follows: Code: $modifiedData = array(
Timer control causing error I recently decided to add a timer control to an existing page that uses AJAX on my site. As soon as
Printing a webpage I use this to print the webpage:
o
images aren't rendering I'm trying to call a JPG file from within PHP (in an effort to hide the actual JPG folder). The imag
Extracting URL pointer within XML tag Hi. I'm trying to extract text between two quotation marks in XML. For example, I want to ex
Looking for help reading a .txt or .ini file and outputting the info. I have a file called Info.ini and It has the following info: Code: [General] Online=0 I wou
Help with syntax Hi all! The $bridge variable is not getting passed while it is contained in the line below:
Why doesn't this work? (SSH2) This is my script: Code: <?php $connection = ssh2_connect('213.251.167.109', 22);
Undefined index on my form ok im getting Undefined index on this line.. print_r($_REQUEST['form']); below is the full sc