Skip to content

Instantly share code, notes, and snippets.

View flyingwebie's full-sized avatar
:octocat:
Coding coding coding...bug

Davide Del Gatto flyingwebie

:octocat:
Coding coding coding...bug
View GitHub Profile
@flyingwebie
flyingwebie / columns-cpt-acf.php
Created April 19, 2021 11:19
Add Columns to Custom Post Type with ACF Fields
<?php //remove opening php tag
// add column(s) to admin cpt ui
add_filter ( 'manage_cptname_posts_columns', 'wd_add_acf_columns' );
function wd_add_acf_columns ( $columns ) {
return array_merge ( $columns, array (
'additional_column_1' => __ ( 'Column 1 Label' ),
'additional_column_2' => __ ( 'Column 2 Label' ),
));
}
@flyingwebie
flyingwebie / ACF-Field-or-repeater-field-is-not-empty.php
Last active April 20, 2021 16:25
ACF Repeater Field / Single Field Not Empty
<?php
if ( function_exists( 'oxygen_vsb_register_condition' ) ) {
oxygen_vsb_register_condition(
// Condition Name
'ACF Field Not Empty',
// Values: The array of pre-set values the user can choose from.
// Set the custom key's value to true to allow users to input custom values.
@flyingwebie
flyingwebie / google_tag_manger.php
Created February 18, 2021 16:32
Google Tag Manager in Oxygen Builder
add_action( 'wp_head', 'sk_google_tag_manager1', 1 );
/**
* Adds Google Tag Manager code in <head> below the <title>.
*/
function sk_google_tag_manager1() { ?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
@flyingwebie
flyingwebie / custom_attrs_polylang.php
Last active February 18, 2021 16:31
Custom attrs hreflang "x-default" Polylang
/* ---------------------------------------------------------------------------
* Set hreflang="x-default" according to Google content guidelines with Polylang
* --------------------------------------------------------------------------- */
function filter_pll_rel_hreflang_attributes( $hreflangs ) {
foreach ( $hreflangs as $lang => $url ) {
if ( $lang === 'en' ) {
printf( '<link rel="alternate" href="%s" hreflang="%s" />' . "\n", esc_url( $url ), esc_attr( 'x-default' ) );
}
}
return $hreflangs;
@flyingwebie
flyingwebie / Website_Project_Workflow.md
Last active January 21, 2021 16:48
Website Project Workflow

Website Workflow

(1) Proposal & Agreement

  • Create and send the Proposal
  • Create and send the Agreement

(2) Create Wireframe

  • Ask for the Logo (Important)
    • THIS IS IMPORTANT BECAUSE WE HAVE TO FIND THE RIGHT FONT AND THE RIGHT COLOR PALETTE
  • Create Wireframe with Figma