On my non-WordPress sites, I generally insert information common to multiple pages in one of two ways:
- Simply include a file containing the information
- Include a simple value in the article stored in the database (e.g. $Symbol - without the PHP tags), then use str_replace to replace that value with something
Can someone tell me how to do that in WordPress? I started playing with the Custom Field and Shortcode functions, but I’m not getting anywhere. It’s needlessly complex, and the directions are very confusing.
I think the simplest solution would be to include a separate PHP file by default.
For example, let’s say I create a file at wp-content/themes/twentyfifteen-child/custom.php
How could I include that in every post by default? If I can accomplish that, I could then create a switch that displays certain blocks of information based on a post’s URL, tags, etc.
Thanks.