This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Template Name: Testimonials */ | |
add_filter( 'body_class', 'io_body_class' ); | |
/** | |
* Adds a css class to the body element | |
* | |
* @param array $classes the current body classes | |
* @return array $classes modified classes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'genesis_before_comments', 'io_related_posts' ); | |
function io_related_posts() { | |
$relatedPosts = get_field( 'related_posts' ); | |
if( $relatedPosts ): | |
echo '<div class="related-posts-container">'; | |
echo '<h3>Related Posts</h3>'; | |
echo '<ul class="related-posts">'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'genesis_after_header', 'io_news_featured_news_post' ); | |
/** | |
* Outputs a custom loop with one features post | |
* | |
* @global mixed $paged current page number if paginated | |
* @return void | |
*/ | |
function io_news_featured_news_post() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WPML Language Selector | |
function io_language_selector( $english, $arabic ) { | |
if ( 'en' == ICL_LANGUAGE_CODE ) { | |
return $english; | |
} | |
elseif ( 'ar' == ICL_LANGUAGE_CODE ) { | |
return $arabic; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add the below code in AppDelegate.swift inside of didFinishLaunchingWithOptions function | |
UINavigationBar.appearance().barTintColor = UIColor.white | |
UINavigationBar.appearance().isTranslucent = true | |
UINavigationBar.appearance().shadowImage = UIImage() | |
UINavigationBar.appearance().backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0) | |
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white] | |
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default) | |
OlderNewer