samedi 25 novembre 2017

Dynamically Include CSS in Wordpress Site Via PHP

Alright, so I struggled with this for days. I'm still in the process of learning PHP. Meanwhile, I'm building a site that I need to make a custom blog template so multiple authors can post blogs on it. The authors know nothing about any code language at all, and therefore, the easiest way out of this (have them manually apply CSS classes) is out of the question. Therefore, I need to apply CSS to all new blog posts but not to any other kind of page dynamically. I've scoured the interwebs trying to find a way out and can't find any solution that works. Heres what I've tried to implement into my functions page so far:

if (is_singular('post')) {
echo '<link rel="stylesheet" type="text/css">#primary p{margin-bottom: 10px; font-family: Alice; color: #fff; text-align: justify;

text-indent: 50px;}'; } I know in advance that this code is butchered. I also know that this question is a bit unclear. When the answers start rolling in I'll be glad to clarify in any way I can. I'm still a student so bear with me. Thanks, all.

Aucun commentaire:

Enregistrer un commentaire