Many websites feature Digg buttons on select posts to drive targeted sharing. Adding the Digg script directly to single.php shows it on every post, which isn't ideal. Manually inserting it per post is inefficient. This proven method, used by experienced WordPress developers, leverages custom fields for precise control on specific posts only.
Open your theme's single.php file and locate the line resembling <?php the_content(); ?>.
Replace it with this code:
<?php the_content(); ?>
<?php
$digg = get_post_meta(get_the_ID(), 'Digg', true);
if ($digg) {
echo $digg;
}
?>Next, add this code inside the loop where you want the button to appear:
<?php echo get_post_meta(get_the_ID(), 'Digg', true); ?>Style it as needed, save single.php, and upload to your theme folder.
When editing a post, add a custom field like this:

Use key Digg and paste the Digg button script/HTML as the value. WordPress will display the button only on that post.
Live example: