Skip to content

Instantly share code, notes, and snippets.

View fgrweb's full-sized avatar

Fernando Garcia Rebolledo fgrweb

View GitHub Profile
@yankiara
yankiara / oxygen-repeater-dynamic-query.php
Last active July 15, 2024 15:17
Use dynamic queries with Oxygen's repeater
/* I'll put here different examples of dynamic query for Oxygen repeater :
* - Use one of the following repeater_dynamic_query definitions
* in code block just BEFORE the repeater
* - Set the repeater custom query settings : post type, number of posts, order...
* - Add the remove_action in a code block AFTER the repeater
*/
/****************************************************************************************************
* Display related posts for any CPT with taxonomy:
@davidnaviaweb
davidnaviaweb / .gitconfig
Created September 6, 2019 12:41
A bunch of useful git shorthand commands.
## Logs ##
# pretty log #
l = log --pretty=format:"%C(Yellow)%H\\ %C(reset)%ad\\ %C(Green)%cr%C(reset)%x09\\ %Cred%d\\ %C(Cyan)%an:\\ %C(reset)%s" --decorate --date=format:%c
# tree log #
lg = log --graph --oneline --decorate --all
## Add ##
# add #
a = add
# add all indexed modified files #
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 27, 2024 15:44
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@bradonomics
bradonomics / genesis-open-graph.php
Created April 16, 2015 03:52
Adding Open Graph Meta Tags to the Genesis Theme Head
<?php
//* Call the First Image in a Post (Used in the Open Graph Call Below)
function catch_first_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];
@srikat
srikat / functions.php
Created December 15, 2013 08:05
Moving Footer widgets and Footer outside Site Container in Lifestyle Pro (Genesis)
//* Reposition the footer widgets
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
add_action( 'genesis_after', 'genesis_footer_widget_areas' );
//* Reposition the footer
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
add_action( 'genesis_after', 'genesis_footer_markup_open', 11 );
add_action( 'genesis_after', 'genesis_do_footer', 12 );