Category: Snippets
Set Viewport Meta via PHP Snippet
Hello, we’re using Divi as our main page builder over on gooloo.de and have seen, that there is missing a header for visually impaired people. This universal PHP Snippet sets the device width as the main width and enables scrolling up to 5x zoom into the page. Place it anywhere in your functions.php, or via…
Post List inspired by Spiegel.de
We really enjoy our SPIEGEL+ Membership and we’re genuinely in aw with the work they do on a daily basis, even when sometimes our opinion differ. We wanted to have a very basic version of how they style their posts in the DER SPIEGEL App on Android. We’re using here a dynamic shortcode with added…
Add PDF as E-Mail Attachment based on Subject
Hi, we were looking for a very simplistic code, that is not based on a Plugin specifically, but rather all E-Mails sent through the query. We’re now using this code. Explanation In $subject add specifically which subject line should be used. This needs to be an exact match. In $pdf_id add the media library item…
[Update] Animated Gift Box Overlay with FontAwesome for a Giveaway
We used this code example to promote a giveaway with Lush. You can use and edit this code freely. Also: If you don’t want the additional functionality, scroll down, to only use the DIV container, and associated CSS. Add as a PHP Snippet to your functions.php, f.ex. via Code Snippets Plugin. See the Pen Animated…
Automatically append a Word or Phrase after a Post Title, based on Category ID
This code is very simple. It adds a seperator (|) and a desired word or phrase at the end of a post, when it is in your defined category ID. For example, if you set the ID to 1, all posts in category ID 1 will have this text appended. You can see it in…
Add a Text (f.ex. Privacy-related) before your Comments
With this code, an text passage will be placed right before your comments, if they’re open for that post. You can modify the text within and use basic HTML. To use this, add it to your Theme’s functions.php, or via a Code Snippet Plugin.
Notify IndexNox API on Category description Update
We’re using RankMath for all of our SEO needs, but one place hasn’t been integrated fully into any SEO Plugin: The Categories. We saw, that categories’ descriptions we’re outdated and no Search Engine was notified, whilst posts, and pages, we’re updated correctly. To add the categories’ edit, we’ve added the following Code sample. Add it…
Last modified Schema Output Shortcode
Especially, when you’re writing irregularly or you simply want Google and Co. to exactly know, when your blog was last edited, you can add this code to your Theme’s functions.php, or via a Code Snippet Plugin. Place it at the bottom of your website, f.ex. in the Footer, for a visible “Last Edit” Date output.…
Remove class from Post Thumbnails
When you use this code, it will remove all classes associated to your <img>. This might be especially helpful, when you’re switching from Blogger to WordPress. To use this code, add it to your Theme’s functions.php, or by a Code Snippet Plugin.
Remove surrounding <p> from <img> tags
Using this snippet, your image will not be contained within a <p> tag. So, instead of <p class=”xy”><img src=””>, your img will be embedded in the <img> Tag only. This might be helpful for page builders, like Divi, or Elementor. To use this, add this function to your functions.php or via a Code Snippet Plugin.