I’ve done this before, and know it’s pretty simple – but can’t remember.
How could I manually code in a ‘Facebook’ and ‘Twitter’ icon to appear at the end of every WordPress post within my theme? I’ve tried a simple test inside ‘single.php’ and ‘archive.php’ by adding a 200px wide div box with a red border, but couldn’t see it appear. I think I could be reading the PHP within those files wrong and placing my div box in the wrong space.
Where would I place the code for these to appear at the end of every post? And in between which other code?
I don’t want to use a plugin as I’d like to customize those areas a good bit, and would rather hardcode as I remember it being pretty straightforward.
Open your theme folder (wp-content/themes/THEMENAME/). Depending on your theme setup, your looking for a content.php or a content-post.php. The content files are called depending on whether its a page, post, search, etc. Just go through each content file and echo something at the top until you find that one that pertains to your posts, then you can add your social icons at the bottom of that content file.