Skip to content

Instantly share code, notes, and snippets.

@oalansari82
oalansari82 / functions.php
Last active May 23, 2017 09:52
Google Map with Multiple Markers in Genesis using ACF Pro
<?php
add_action( 'init', 'register_cpt_locations' );
/**
* Create Locations custom post type
*/
function register_cpt_locations() {
$labels = array(
'name' => __( 'Locations', 'locations' ),
'singular_name' => __( 'Location', 'locations' ),
<?php
/**
* This file adds a timeline to your desired page in Genesis Framework.
*
* @author Omar Al-Ansari
* @link http://www.alansari.io
*/
// Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
@oalansari82
oalansari82 / functions.php
Last active October 25, 2016 17:20
Add sources field in Genesis using ACF Pro
<?php
// Only include the code below this line
add_action( 'genesis_entry_footer', 'io_sources_custom_fields' );
/**
* Add sources to posts, if posts have sources assigned
*/
function io_sources_custom_fields() {
if ( is_singular( $post_types = 'post' ) ) {
@oalansari82
oalansari82 / functions.php
Last active October 27, 2016 17:14
Create YouTube Videos page using CPT, ACF and Featherlight
<?php
// Only include the code below this line
add_action( 'init', 'register_cpt_youtube_videos' );
/**
* Create YouTube videos custom post type
*/
function register_cpt_youtube_videos() {
$labels = array(
@oalansari82
oalansari82 / functions.php
Last active September 5, 2016 22:05
Language support in Genesis child themes
<?php
//* Do not include the opening php tag
// The below code will go into your functions.php right before "//* Start the engine"
// once done you need to upload your language files to child theme's /languages folder.
//Child Theme Language override
define('GENESIS_LANGUAGES_DIR', STYLESHEETPATH.'/languages');
define('GENESIS_LANGUAGES_URL', STYLESHEETPATH.'/languages');