كود PHP:
if ( function_exists( 'the_ratings' ) && ! function_exists( 'sb_post_ratings' ) ) {
function sb_post_ratings( $content ) {
if ( is_singular( 'post' ) ) {
ob_start();
echo '<div class="sb-post-ratings">';
echo '<h3 class="sb-post-ratings-title">لا تذهب دون ترك تقييمك للموضوع</h3>';
the_ratings();
echo '</div>';
$output = ob_get_clean();
}
$content = $content . $output;
return $content;
}//end sb_post_ratings()
function sb_ratings_styles() {
echo '<style>
.sb-post-ratings {<br />
background: #E5E5E5;<br />
border: 0.125em solid #666666; /* 2/16 */<br />
border-radius: 0.313em; /* 5/16 */<br />
text-align: center;<br />
padding: 1.25em; /* 20/16 */<br />
}<br />
</style>';
} // End function sb_ratings_styles.
add_action( 'wp_head', 'sb_ratings_styles' );
add_filter( 'the_content', 'sb_post_ratings', 10, 1 );
}// End if().
في عهذا الكود قمت بالتحقق من وجود الدالة