Hi folks,
I'm brand new to the group, so forgive me if I commit any faux pas.
I know very little about coding. I have not formal training or experience. I have several Wordpress websites that I really use for little else than to try to teach my self how to code. most of what i do is copying code then tweaking it until I get what I want. Over the years, I've done pretty well. I thought my process was sound, and that everything would work fine, but alas, no. So, I’m turning to you for help.
Here's the deal. I created a custom field in Wordpress for a pithy quotation to go above the content of each post. All good. I liked the style of the blockquote in the theme I’m using, so I just wrapped the post quote in a blockquote. I now want to tweak the blockquote style within my content, but I don’t want to mess with the post quote. So, I copied the blockquote rules in the stle.css file, pasted them below and changed the name for blockquote to postquote. I assumed that postquote would look identical to blockquote, but I was wrong. But shouldn’t it? I would think so.
Here's the code I’ve got going on:
In my content-single.php file:
And in the style.css file for the blockquote:
And for the postquote:
Again, I thought they’d be identical, but they’re not. Look at the attached image to see (sorry, this site in on my computer, so not accessible). The blockquote at the top is the postquote and the one in the middle is the blockquote (as they should both appear...also, ignore the drop cap below the blockquote...that was from another test
For awareness, at the end of the day, I want the postquote to look like the current blockquote, then I want the block quote to look like the rest of the content, but all lines indented on the left and right (as you would imagine a traditional blockquote from school essays).
Finally, before you ask, the answer is yes, I’m using a child theme, so no worries that I’ll mess up the existing one (which is Cenote if that matters).
Thanks so much for your help.
Josh
I'm brand new to the group, so forgive me if I commit any faux pas.
I know very little about coding. I have not formal training or experience. I have several Wordpress websites that I really use for little else than to try to teach my self how to code. most of what i do is copying code then tweaking it until I get what I want. Over the years, I've done pretty well. I thought my process was sound, and that everything would work fine, but alas, no. So, I’m turning to you for help.
Here's the deal. I created a custom field in Wordpress for a pithy quotation to go above the content of each post. All good. I liked the style of the blockquote in the theme I’m using, so I just wrapped the post quote in a blockquote. I now want to tweak the blockquote style within my content, but I don’t want to mess with the post quote. So, I copied the blockquote rules in the stle.css file, pasted them below and changed the name for blockquote to postquote. I assumed that postquote would look identical to blockquote, but I was wrong. But shouldn’t it? I would think so.
Here's the code I’ve got going on:
In my content-single.php file:
Code:
<?php
$post_quote = get_post_meta($post->ID, 'post_quote', true);
if ($post_quote) { ?>
<postquote><?php echo $post_quote; ?></postquote><br><br>
<?php
} else {
// do nothing;
}
?>
And in the style.css file for the blockquote:
Code:
blockquote {
text-align: center;
font-size: 18pt;
font-weight: bold;
background: #fff9f5;
padding: 20px 40px;
margin: 0;
position: relative;
box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.35) !important;
border-radius: 15px;
}
And for the postquote:
Code:
postquote {
text-align: center;
font-size: 18pt;
font-weight: bold;
background: #fff9f5;
padding: 20px 40px;
margin: 0;
position: relative;
box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.35) !important;
border-radius: 15px;
}
Again, I thought they’d be identical, but they’re not. Look at the attached image to see (sorry, this site in on my computer, so not accessible). The blockquote at the top is the postquote and the one in the middle is the blockquote (as they should both appear...also, ignore the drop cap below the blockquote...that was from another test
For awareness, at the end of the day, I want the postquote to look like the current blockquote, then I want the block quote to look like the rest of the content, but all lines indented on the left and right (as you would imagine a traditional blockquote from school essays).
Finally, before you ask, the answer is yes, I’m using a child theme, so no worries that I’ll mess up the existing one (which is Cenote if that matters).
Thanks so much for your help.
Josh