Introduction to WordPress (Gutenberg) Block Filters • WPShout

[ad_1] Like many, I’m still very much getting my sea legs when it comes to doing wed-development tasks that affect aspects of the (Gutenberg) Block Editor. While its no longer new, it’s never really overlapped very clearly with work either I (or a client) have needed to do, so I’m very much in learning mode with this article from Dmitry Mayorov over at CSS-Tricks. All that is to say: if you click over and this entire article just goes over your head, have no fear (you likely won’t need to do this stuff anytime soon) and I get you. For those of you who aren’t lost when terms like ES6, JSX, and React come up, I really do think this article is great intro to a topic I’m sure I’ll need to use… sometime. His adding of the size attribute to the button element is actually rather similar to a task I failed and gave up on a few months ago. Happy hacking! Visit css-tricks.com → [ad_2] Source link

Continue reading

Dynamic Favicons for WordPress • WPShout

[ad_1] I can’t be the only one who sometimes has dozens of tab open, all from my own WordPress site. And then I lose track of which I was seeing the public side of my site, vs the admin side where I writing a post, tweaking settings, etc. It’s because of the (admittedly minor, but nonetheless real) headache of this that this little article from Thomas Park over at CSS-Tricks caught my eye. In it he explains how he uses a different color of SVG to allow him to distinguish (for example) these back-end tabs from the front-end ones. But what’s cool is that he even goes a step further, making different pages on the public side of his site have different (colored) favicons. I admit the tab-finding problem is small and rare enough to me that I’m not adding implementing this to my to-do list anytime soon. But it sure is good to know that there’s a solution next time it really starts to frustrate me. 🙂 Visit css-tricks.com → [ad_2] Source link

Continue reading

Accessible-Colors.com • WPShout

[ad_1] At a recent (virtual) Fort Collins WordPress meetup, someone shared this little site which I’ve never encountered before: Accessible-Colors.com. As you might guess from the name, it’s a simple little site/tool to tell you if the contrast between two colors you’re using in a design is in line with the WCAG 2.0 standard for contrast. If you color’s don’t quite work, it’ll give you a way to make them work by modifying one or the other of them. In that way, it’s just flexible enough. It doesn’t do more than two colors, and it doesn’t give more than two recommendations. But that’s really all I think it needs to. I’m sure there are lots of other ways to tell if colors conform to WCAG standards, but I love how simple and quick this one is. Definitely worth a bookmark 🤓 Visit accessible-colors.com → [ad_2] Source link

Continue reading

How to Set Your Site Icon (Favicon) in WordPress • WPShout

[ad_1] One thing every WordPress site should have is a site icon, also called a “favicon”—the little tiny image that shows up in your browser tabs to let you tell one site from another. Ours at WPShout is a orange circle with a bullhorn inside it, so you which tabs are us. For the more visually-inclined, here’s a relevant summary image of a site icon: Image illustrating a site favicon taken from WordPress itself, because they illustrated it so well ☺️ This video Quick Guide walks you through how to change your WordPress site icon. It’s easier now than ever, because WordPress has embedded this feature right into the Customizer. And WordPress’s standard site icon uploading process has you covered for all the less common uses for favicons (such as serving as retina-ready desktop app icons if someone saves a shortcut to your site onto her iPad homescreen). Here’s my video guide on how to set your site icon in WordPress: And here’s our text guide to the same information: How to Change the Site Icon of Your WordPress Site Collect the image that you’ll use as your site icon (if it’s not already on your WordPress site). Open the Customizer in WordPress. You can click “Customize” along the top bar (if you’re viewing pages on your site), or “Appearance > Customize” in the left-side menu (if you’re in your WordPress admin area). Open the “Site Identity” panel by clicking it from the initial listing panel. Open the “Site Icon” section. If it hasn’t been used before on your site you’ll click the “Select Image” button. There you will select an image already in your image library, or have the ability to upload a new one. (If you’ve ever used WordPress’s media library, this screen should be familiar.) You will have the ability to crop the image. If it was square, you’ll probably skip this by clicking “Crop Image” without resizing the selection box. (If you do need to crop, drag away.) With that, you’ll be set. Your browser tab may immediately update with the image. If it doesn’t, but you see something like this, you’re set: (Browser caching can be hard to debug, but refresh may fix it for you.) 🙂 And that’s how to change your WordPress site icon! Streamlining this process has been one of the default Customizer’s sweetest features. Let us know if you have any questions—we’re happy to help. [ad_2] Source link

Continue reading

Updating a Publishing Plugin to the Block Editor • WPShout

[ad_1] Helen Hou-Sandí is certainly one of the most important people making (core) WordPress better, and she’s been doing it for years. So I take a pretty keen interest in what she’s working on. So when this post about updating a “legacy” WordPress post-meta post so that it was compatible, I knew I had to read it. And a few months later, I finally did. 🤪 I really appreciated both the article’s style and comprehensiveness. So please give it a read if “modernizing an old plugin for Gutenberg” is somewhere on your to-do list. The article tackles a number of things I’d meant to understand better for years in an approachable way: writing compatible JavaScript and using wp-scripts are the two that leap to mind. Visit helen.blog → [ad_2] Source link

Continue reading

You Can Label an `if` in JavaScript • WPShout

[ad_1] Interesting little article over at CSS Tricks from Alex Riviere. In it, he explains that it’s possible to label “if” (and other “block type”) statements in JavaScript. I’ve never heard (or thought about) such a feature. As Alex says, it’s also a feature that I feel like I won’t use much, because it’s something most people neither know to be possible or will necessarily understand. (I’m always in favor of “broad comprehensibility” above “cleverness.”) But he makes the good point that for specific contexts where many-loops or ifs are not avoidable, it makes sense that these labels would make it a lot easier to track what’s happening. This example (copied directly from his article) makes the point of their value pretty clearly to me: let x = 0; outerLoop: while (x < 10) { x++; for (let y = 0; y < x; y++) { // This will jump back to the top of outerLoop if (y === 5) continue outerLoop; console.log(x,y); } console.log(‘—-‘); // This will only happen if x < 6 } Obviously, real code won’t have these types of “toy conditions.” But the number of times I’ve wondered if a break or continue statement was terminating the thing I meant it to is definitely dozens, and maybe hundreds. So good to know that JavaScript offers a solution to it 🤓 Visit css-tricks.com → [ad_2] Source link

Continue reading

WordSesh 2021 is Approaching • WPShout

[ad_1] Next week(!) is WordSesh. For those who aren’t familiar, WordSesh is a free online-first (has been doing it since before it became how all events are ;p) WordPress conference. It is totally free for live (and nearly-live attendance). (If you’re a more-than-24-hours-after-conference-end slow poke on a talk, you’ll just have to become a WPSessions member to see talk recordings.) Our friend Brian Richards (most known for WPSessions) has been running the conference for the last few years, and this years lineup looks set to be great as ever. I’m probably not going to prioritize attending in real-time but that the recordings will be available for free for the whole-event-duration after certainly has my attention. I doubt I’m alone in feeling a little “behind and overwhelmed” as we swing into the second year of COVID-19-infected reality. So attending WordSesh may be just the thing to get me “back on the horse.” (And if not, that’s OK too ❤️) Visit wordsesh.com → [ad_2] Source link

Continue reading

CSS Neon Lights • WPShout

[ad_1] Longtime readers may have caught on to the fact that I’m a big sucker for cool CSS techniques I would have never come up with or figured out. And this is one more example on that. Over at CSS-Tricks, Silvia O’Dwyer offers a guide to making some really compelling “neon light” effects with CSS. Honestly the visuals of the effect were enough to convince me this was cool enough to share. But she takes it a step further and covers both adding a “pulsating” effect, and even reminds us to turn it off for motion-sensitive visitors. It’s just an all around great little tutorial. Give it a look 🙂 Visit css-tricks.com → [ad_2] Source link

Continue reading

Good Interview with Matt Mullenweg & Josepha Haden Chomposy • WPShout

[ad_1] I really enjoyed watching this little interview with between Mark & Keith from Highrise Digital and Matt Mullenweg and Josepha Haden Chomposy (who are probably the two most influential people shaping WordPress today). Nothing that anyone said was really a surprise or revelation to me, but it was all helpful and “orienting” to hear again what their thought process is, what’s been happening lately, etc. For myself, I actually left the interview thinking that “the future or WordPress themes” is even to these important and influential people still an open question. Which I think is both appropriate and a bit annoying. I seems clear that “full-site editing” is reshaping themes in important ways, but not knowing where we’re going leaves one a little unsure what to do. But it also means there’s time to jump in and influence the direction, if that’s something you’ve got interest and time for 🤓 Visit youtube.com → [ad_2] Source link

Continue reading

How to Create WordPress Custom Page Templates (& Why) • WPShout

[ad_1] There are many many ways you can change the look of a specific page on your WordPress site. You can change the content inside the WordPress content editor. You can change the CSS rules that affect the site. Or create a new file in your WordPress theme’s template hierarchy to correspond to the specific page. Or you can use a theme page template designed specifically for that page. The last one is what we’re talking about here. In this tutorial we’ll cover both how to create a WordPress custom page template, and why you might want to do that. We’ll start with the why. When you say “WordPress Theme Custom Page Template”, what do you mean? There’s a huge terminology problem with this topic. As I hinted at above, there are a lot of things with the vague notion of “page” and “template” in the WordPress world that aren’t what we’re talking about here. The first thing I *don’t* mean when saying “WordPress custom page template” is “a WordPress theme.” (Many people new to WordPress say “templates” when they mean “a WordPress theme.”) So what do I mean by “custom page template”? I mean what is shown at right. For example, you’re editing the Page content type in WordPress (although, as we’ll see later, it can now include other WordPress content types). And while editing your page, you notice the “Page Attributes” box, And within that, you might (dependent on if your theme already has these templates) see this “Template” dropdown. This selection box is illustrated on the right (it’s also on the right side of your “page editing” screen). If you see this dropdown, it’s because your theme provides some of these “custom page templates.” They’re actually files in your currently active theme’s folder (or its parent), and have a single distinguishing feature we’ll come to later. But this selectable dropdown of named page templates is what we’re talking about here today. How Does This Fit Into the Template Hierarchy? I’ve written before, and I’ll likely do so again, about how the template — there’s that word again — hierarchy is really the key concept you need to understand to build or modify a WordPress theme. (Here’s our quick intro to it.) Almost everything else is a detail you can work out once you’ve understood the basic dynamic of the template hierarchy. The specific thing we’re meaning today, though, sits outside of the template hierarchy. This “selected template” essentially replaces the whole selection process of the template hierarchy. If a Custom Page Template was selected in the dropdown we showed above, that “template” file will be used. Full stop, no exception. To restate that, if a custom page template is selected, that “template” file will be used. Full stop, no exception. If not, then the WordPress template hierarchy will look for a somewhat different way that someone might have tried to style a specific page — with a page-123.php or page-custom-template-utilizer.php file. (The difference between the Custom template, and one with this page-$id or page-$slug structure is really only in interaction and interface.) If neither of those is found, WordPress will fall back to page.php, if it exists, and if not we’d end up at the ultimate fallback, index.php. If you’re wondering why you’d use this method as opposed to the numeric or slug one — in either case you’re creating a custom file in your theme, after all — the reason is that using custom templates gives you more flexibility and independence between your theme and your site’s database and content. For that reason, I’d recommend it in just about every situation when you’re unsure which to go with. With the numeric or slug-based page-*.php structure, you’re forced to make your theme know about the specific way your WordPress database data is right now. (So if you reuse the theme on a different WordPress site, for example, that file is useless.) How Do I Make a WordPress Custom Page Template? OK, so we know that custom page templates will supercede the WordPress template hierarchy. And that we’ll make use of them on actual pages of our WordPress site by selecting them from a “Template” dropdown menu on the right-bar of the relevant piece of content. So it’s time to get to the process for creating a WordPress custom page template. What you’ll do is, add to your theme (and it really should be a child theme unless there’s a very strong constraint making that impossible for you) a file with a name like my-template.php or really-cool-awesome.php. It doesn’t really matter, as long as you don’t actually use a name that’s part of the template hierarchy, you’re golden. (Which means: do not use a name like page-whatever.php. As we touched on above, WordPress’s template hierarchy thinks it owns a file named with that pattern.) Once you’ve got the file (cool-page-template.php, of whatever you prefer), you should start it like this: <?php /* Template Name: Name To Appear In The Dropdown */ ?> This is my custom template. And you’re basically done. As you can probably guess, the name that will appear in the “Template” drop down is what I cleverly called “Name To Appear In The Dropdown.” Just like your theme’s style.css file, or a plugin’s main file, WordPress uses the information inside this code comment to provide it with context to work. Then the content of our pages will, in this case be the very basic HTML text “This is my custom template”. As you might guess, here is where you’re much more likely to put the HTML contents you want to appear on the page. So your <h1> tags, <p> tags, and perhaps (if you’re fancy 🤪) some PHP to do custom behavior you want to show off. Why Your WordPress Custom Page Template Doesn’t Show Up I’ve (more than once) had the experience that my new WordPress page template doesn’t show up. By far the most common cause is that I’ve typoed (or misremembed) what

Continue reading
1 2