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
function my_acf_options_page_settings( $settings ) | |
{ | |
$settings['title'] = 'Global'; | |
$settings['pages'] = array('Header', 'Sidebar', 'Footer'); | |
return $settings; | |
} | |
add_filter('acf/options_page/settings', 'my_acf_options_page_settings'); |
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
function isMobile() { | |
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]); | |
} |
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
function lxb_google_analytic_dashboard_bouncer() { | |
//is the GAD plugin active in the first place? | |
if(is_plugin_active('google-analytics-dashboard/google-analytics-dashboard.php')) { | |
//get the current user | |
$current_user_id=get_current_user_id(); | |
//are you a super admin? if so, great |
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
-webkit-transition: all 500ms ease-out 1s; | |
-moz-transition: all 500ms ease-out 1s; | |
-o-transition: all 500ms ease-out 1s; | |
transition: all 500ms ease-out 1s; |
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 | |
// check if the repeater field has rows of data | |
if( have_rows('repeater_field_name') ): | |
// loop through the rows of data | |
while ( have_rows('repeater_field_name') ) : the_row(); | |
// display a sub field value | |
the_sub_field('sub_field_name'); |
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 | |
// check if the flexible content field has rows of data | |
if( have_rows('flexible_content_field_name') ): | |
// loop through the rows of data | |
while ( have_rows('flexible_content_field_name') ) : the_row(); | |
if( get_row_layout() == 'paragraph' ): | |
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
background: url(images/bg.jpg) no-repeat center center fixed; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; | |
-o-background-size: cover; | |
background-size: cover; |
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
if ( get_the_post_thumbnail($post_id) != '' ) { | |
echo '<a href="'; the_permalink(); echo '" class="thumbnail-wrapper">'; | |
the_post_thumbnail(); | |
echo '</a>'; | |
} else { | |
echo '<a href="'; the_permalink(); echo '" class="thumbnail-wrapper">'; | |
echo '<img src="'; |
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
/** | |
* Adds CPTs to the list of available pages for a static front page. | |
* | |
* @param string $select Existing select list. | |
* @return string | |
*/ | |
function add_cpt_to_front_page_dropdown( $select ) | |
{ | |
if ( FALSE === strpos( $select, '<select name="page_on_front"' ) ) | |
{ |
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
function wpa18013_add_pages_to_dropdown( $pages, $r ){ | |
if('page_on_front' == $r['name']){ | |
$args = array( | |
'post_type' => 'stack' | |
); | |
$stacks = get_posts($args); | |
$pages = array_merge($pages, $stacks); | |
} | |
return $pages; |