Skip to content

Instantly share code, notes, and snippets.

View Tiex84's full-sized avatar
🍹

Lorenzo De Angelis Tiex84

🍹
View GitHub Profile
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
git rm -r --cached .
git add .
git commit -m ".gitignore fix"
function hap_hide_the_archive_title( $title ) {
// Skip if the site isn't LTR, this is visual, not functional.
// Should try to work out an elegant solution that works for both directions.
if ( is_rtl() ) {
return $title;
}
// Split the title into parts so we can wrap them with spans.
$title_parts = explode( ': ', $title, 2 );
// Glue it back together again.
if ( ! empty( $title_parts[1] ) ) {
<?php
$orderby = 'name';
$order = 'asc';
$hide_empty = true ;
$cat_args = array(
'orderby' => $orderby,
'order' => $order,
'hide_empty' => $hide_empty,
'exclude' => array(15 ),
@Tiex84
Tiex84 / autoGenerateRoute.tsx
Created March 6, 2023 13:29
React + Vite - Auto generates routes
// Auto generates routes from files under ./pages
// https://vitejs.dev/guide/features.html#glob-import
const pages = import.meta.glob('./pages/*.jsx', { eager: true })
const routes = Object.keys(pages).map((path) => {
const name = path.match(/\.\/pages\/(.*)\.jsx$/)[1]
return {
name,
path: name === 'Home' ? '/' : `/${name.toLowerCase()}`,
component: pages[path].default,