Skip to content

Instantly share code, notes, and snippets.

View nusserstudios's full-sized avatar

Nusser Studios nusserstudios

View GitHub Profile
@nusserstudios
nusserstudios / vercel.json
Created November 2, 2022 06:10
Hugo vercel.json
{
"build": {
"env": {
"HUGO_VERSION": "0.105.0"
}
},
"headers": [
{
"source": "/(.*)",
"headers": [
### Keybase proof
I hereby claim:
* I am nusserstudios on github.
* I am nusserstudios (https://keybase.io/nusserstudios) on keybase.
* I have a public key whose fingerprint is 0F1F 1EBF 39ED 1483 1C26 7126 C661 1069 AB00 7518
To claim this, I am signing this object:
<?php if( get_field('field_name') ): ?>
<?php the_field('field_name'); ?>
<?php endif; ?>
@nusserstudios
nusserstudios / wp-auto-title-alt-from-img-function
Created August 9, 2023 10:37
WordPress - automatically set the image Title, Alt-Text, Caption & Description upon upload
/*
Automatically set the image Title, Alt-Text, Caption & Description upon upload
https://brutalbusiness.com/automatically-set-the-wordpress-image-title-alt-text-other-meta/
*/
add_action( 'add_attachment', 'bf_set_image_meta_upon_image_upload' );
function bf_set_image_meta_upon_image_upload( $post_ID ) {
// Check if uploaded file is an image, else do nothing
if ( wp_attachment_is_image( $post_ID ) ) {
$my_image_title = get_post( $post_ID )->post_title;
// Sanitize the title: remove hyphens, underscores & extra spaces:
@nusserstudios
nusserstudios / gist:2850ebf5bd94548e1ccdf02d97e36614
Created March 12, 2024 21:24
WordPress Yoast ACF Field in Title or Meta Description
%%cf_ADD-YOUR-ACF-FIELD-NAME-HERE%%
@nusserstudios
nusserstudios / nvmCommands.js
Created November 12, 2024 19:29 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node