Sign in

Kenny

@kennytran.com
1.4K followers 100 following 154 posts

Design Engineer by ☀️ • Tired Dad by 🌙 • Experimenting with AI in-between and trying to remember to write about it. 🔗 kennytran.com 📍 London, UK

PostsRepliesMedia
Kenny @kennytran.com · 01/01/2025
It’s sad that Amazon was the first app I installed on the iPhone 📱
A screenshot of a list of apps installed on my iPhone
210
Kenny @kennytran.com · 10/12/2024
Getting the VIP treatment
Screenshot of image with the words ‘W VIP’ at the top and ‘You’re Invited’ below it
000
Kenny @kennytran.com · 28/11/2024
Found a solution! I appended a 'tax_query' to the WP query that runs on the /posts endpoint. Checking if the post has any terms in the taxonomy Then I can pass in the argument to the endpoint to filter posts /wp-json/wp/v2/posts?has_taxonomy_term=false
WordPress filter that modifies the /post endpoint to filter posts based on whether the posts has any terms in a taxonomy
260
Kenny @kennytran.com · 27/11/2024
I’m spent after helping launch two websites in a week 😴. Well deserved Makgeolli on a school night
020
Kenny @kennytran.com · 19/11/2024
This Figma plugin just saved me so much time and pain. Created this logo grid in 5 mins www.figma.com/community/pl...
Image displaying a grid layout of various payment acceptance logos, including widely recognised symbols such as Apple Pay, PayPal, Visa, MasterCard, Discover and American Express, arranged neatly in rows and columns.
010
Kenny @kennytran.com · 17/11/2024
Visited clearsky.app for the first time and for a second I was thinking ‘Dafuq did I say?’
010
Kenny @kennytran.com · 12/11/2024
Escaped London for the week because I had enough of the rain… welp
110
Kenny @kennytran.com · 12/11/2024
I spent waaay too much time designing this bento grid in the browser
Screenshot displaying the ongoing development of my personal website.
210
Kenny @kennytran.com · 09/11/2024
The personal site is crying out for some TLC 👀. Anyone with cool tips for using Astro?
110
Kenny @kennytran.com · 07/11/2024
Helpful snippet of the day: Query the WordPress database to find all posts using a specific block. *Replace 'BLOCKNAME' with your chosen block name.
SELECT
	p.post_name,
	p.post_content
FROM
	wp_posts p
WHERE
	p.post_status = 'publish'
	AND p.post_content like '%BLOCKNAME%'
ORDER BY p.post_date DESC
010
Kenny @kennytran.com · 05/11/2024
Helpful WordPress snippet of the day: Add a template class to the block editor's body element based on the template of the current page.
/**
* Add template class to admin body based on the template of the current page
*
* @param string $classes
* @return string
*/
add_filter('admin_body_class', function ($classes) {
    $template = get_page_template_slug();

    if ($template) {
        $template = str_replace(['templates', 'php', '/'], '', $template);
        $classes .= ' template-' . sanitize_html_class(trim($template));
    } else {
        $classes .= ' template-default';
    }

    return $classes;
});
020
Kenny @kennytran.com · 28/10/2024
Helpful snippet of the day: Query the WordPress database to find all pages that doesn't use the 'default' template
SELECT
	p.post_name,
	pm.meta_value
FROM
	wp_posts p
	LEFT JOIN wp_postmeta pm ON p.ID = pm.post_id
WHERE
	p.post_status = 'publish'
	AND pm.meta_key = '_wp_page_template'
	AND pm.meta_value != 'default'
	AND p.post_type = 'page'
ORDER BY p.post_date DESC
000