I'm not 100% what you mean by child theme. I'm a bit of an novice, I've been looking at some Wordpress.org documentation but I'll be honest, I'm struggling to understand a word of it.This is what you're dealing with here. I'm brand new to this, or might as well be. (Can you tell, I've never owned a website before? haha)
I've gone back to brutally studying the code in my website, an arduious process but so far, seems to be the most effective rather than reading about code (it looks very complicated to write but to read... it is much easier, a good place to start I think)
I've come across this:
<?php if ($blog_article) { ?>
<title>xyz site - <?php echo $blog_posts['title']; ?></title>
<meta name="description" content="<?php echo $blog_posts['excerpt']; ?>">
<?php } else { ?>
<title>xyz site</title>
<meta name="description" content="xyzsite">
Note: My website is not called XYZ Site, I took out identifying info because I received a polite heads up to let me know I had a habit of sharing code unedited which included links and whatnot, anyway, hopefully this is alright? (yes?)
Anyway, back to my point, this code is from the blog.php file in the main directory of my website (it is not from the wp folder). I'm looking at it and wondering whether it is basically saying;
If there is a blog article published from xyz site, show (echo) the title and exert otherwise, show title with content.
Only when you click through to the content, because it isn't yet published, there is nothing to show?
Would the code work still if I removed the if statement and if and else commands? Eg:
<?php { ?>
<title>xyz site</title>
<meta name="description" content="xyzsite">
^^ I don't think that would work. It doesn't make sense. I think the if statement needs to be there, perhas it's the else statement that is the issue?
*Edit*
OK, I gave it a whirl and tried editing a few things, I'm not sure it is anything to do with that... Is there a way to add an "unless" statement? For example;
if ($blog_post) ...
unless...
else...
unless...
That way, we could use the unless command to make it so that if the post is scheduled, don't show the title exert or description.
(I think the else statement refers to whether or not there is an exert, if not, display the description instead, I might be wrong)
If this is possible, how would I write the command into the code (displayed in the first code tags in this message)?