//
// POP ADMIN (plugin depracted and included into functions - 230705)
// It's better to be in the repo and reduce the number of plugins
// Nick Kind 230705
// Big up the Lestor Massif!
//
// HEADER TIDY
//
function pop_admin_header_tidy() {
// category feeds
// remove_action( 'wp_head', 'feed_links_extra', 3 );
// post and comment feeds
// remove_action( 'wp_head', 'feed_links', 2 );
// EditURI link
remove_action( 'wp_head', 'rsd_link' );
// windows live writer
remove_action( 'wp_head', 'wlwmanifest_link' );
// index link
remove_action( 'wp_head', 'index_rel_link' );
// previous link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
// start link
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
// links for adjacent posts
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
// WP version
remove_action( 'wp_head', 'wp_generator' );
}
//
// BETTER TITLE
//
function pop_admin_wp_title( $title ) {
// Do not filter for RSS feed / if SEO plugin installed
if ( is_feed() || class_exists('All_in_One_SEO_Pack') || class_exists('HeadSpace_Plugin') || class_exists('Platinum_SEO_Pack') || class_exists('wpSEO') || defined('WPSEO_VERSION') )
return $title;
if ( is_front_page() ) {
$title = get_bloginfo('name').' - '.get_bloginfo('description');
}
if ( is_front_page() && get_bloginfo('description') == '' ) {
$title = get_bloginfo('name');
}
if ( !is_front_page() ) {
$title .= ' - '.get_bloginfo('name');
}
return $title;
}
add_filter( 'wp_title', 'pop_admin_wp_title' );
//
// HIDES UPDATES FROM NON ADMINS
//
function ts_hide_update_notice_from_all_except_admin_users(){
if (!current_user_can('update_core')) {
remove_action( 'admin_notices', 'update_nag', 3 );
}
}
add_action( 'admin_head', 'ts_hide_update_notice_from_all_except_admin_users', 1 );
//
// CHANGE THE FOOTER
//
function pop_admin_footer() {
// echo '
';
echo 'Customisation by SDWM.';
}
add_filter( 'admin_footer_text', 'pop_admin_footer' );
//
// DASHBOARD WINDOW
//
add_action('wp_dashboard_setup', 'designed_by_thinksoda_dashboard');
function designed_by_thinksoda_dashboard() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Designed and Integrated by SDWM', 'custom_dashboard_help');
}
function custom_dashboard_help() {
echo '
the_sub_field('page_title_h1'); ?>
} else {
?>
the_sub_field('page_title_h1'); ?>
}
?>
// VIDEO HEADER
elseif( get_row_layout() == 'video_header' ):
$choose_graphic = get_sub_field('choose_graphic');
$header_video = get_sub_field('header_video');
?>
elseif( get_row_layout() == 'no_header' ):
endif;
endwhile;
else :
endif;
?>
// CONTENT BUILDER
if( have_rows('content_builder') ):
while ( have_rows('content_builder') ) : the_row();
if( get_row_layout() == 'two_column_image_text' ):
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
$image_on_the = get_sub_field('image_on_the');
$the_image = get_sub_field('image');
$add_buttons = get_sub_field('add_buttons');
$choose_graphic = get_sub_field('choose_graphic');
?>
if( get_sub_field('section_title') ): ?>
the_sub_field('section_title'); ?>
if($add_buttons=='yes'){
include_once('inc_cta.php');
?>
} ?>
endif; ?>
if( get_sub_field('the_content') ): ?>
the_sub_field('the_content'); ?>
endif; ?>
![]()
if( get_sub_field('image_caption') ): ?>
the_sub_field('image_caption'); ?>
endif; ?>
elseif( get_row_layout() == 'title_and_copy' ):
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
$copy_layout = get_sub_field('copy_layout');
$title_indent = get_sub_field('title_indent');
$add_buttons = get_sub_field('add_buttons');
?>
if($copy_layout=='top_and_bottom'){
$copy_width = get_sub_field('copy_width');
$copy_indent = get_sub_field('copy_indent');
?>
the_sub_field('section_title'); ?>
if( get_sub_field('the_content') ): ?>
the_sub_field('the_content'); ?>
if($add_buttons=='yes'){
include_once('inc_cta.php');
} ?>
endif; ?>
} else {
?>
the_sub_field('section_title'); ?>
if( get_sub_field('the_content') ): ?>
the_sub_field('the_content'); ?>
if($add_buttons=='yes'){
include_once('inc_cta.php');
} ?>
endif; ?>
}
?>
elseif (get_row_layout() == 'full_width_video') :
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
$video_placeholder_image = get_sub_field('video_placeholder_image');
$video_embed_url = get_sub_field('video_embed_url');
?>
elseif (get_row_layout() == 'full_width_image') :
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
$image = get_sub_field('image');
$background_fill = get_sub_field('background_fill');
$left_padding = get_sub_field('left_padding');
$right_padding = get_sub_field('right_padding');
?>
![']()
if( get_sub_field('image_caption') ): ?>
the_sub_field('image_caption'); ?>
endif; ?>
if($background_fill == 'yes'){
?>
}
?>
elseif( get_row_layout() == 'text_roll' ):
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
?>
if( get_sub_field('section_title') ): ?>
the_sub_field('section_title'); ?>
endif; ?>
if( have_rows('the_text') ):
?>
while( have_rows('the_text') ) : the_row();
?>
the_sub_field('green_large_text'); ?>
the_sub_field('normal_size_copy'); ?>
endwhile;
?>
else :
endif;
?>
elseif( get_row_layout() == 'facts_and_figures' ):
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
?>
if( get_sub_field('section_title') ): ?>
the_sub_field('section_title'); ?>
endif; ?>
if( have_rows('the_text') ):
?>
while( have_rows('the_text') ) : the_row();
?>
the_sub_field('top_line_of_text'); ?>
the_sub_field('green_large_text'); ?>
the_sub_field('units_for_green_large_text'); ?>
the_sub_field('bottom_text'); ?>
endwhile;
?>
else :
endif;
?>
elseif( get_row_layout() == 'projects_carousel' ):
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
?>
elseif( get_row_layout() == 'team_carousel' ):
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
?>
$args = array(
'post_type'=> 'team',
'post_status' => 'publish',
'posts_per_page' => -1,
'order'=>'DESC'
);
$result = new WP_Query( $args );
if ( $result-> have_posts() ) :
while ( $result->have_posts() ) : $result->the_post();
$photograph = get_field('photograph');
?>
the_field('team_member_name'); ?>
the_field('team_member_position'); ?>
the_field('short_description'); ?>
endwhile;
endif; wp_reset_postdata();
?>
elseif( get_row_layout() == 'news_carousel' ):
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
$news_category = get_sub_field('news_category');
$show_button = get_sub_field('show_button');
$the_page_id = get_the_ID();
$the_post_type = get_post_type($the_page_id);
if($the_post_type=='project'){
$news_prefix = 'Project ';
}else{
$news_prefix = '';
}
?>
if($news_category=='uncategorised'){
$args = array(
'post_type'=> 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'order'=>'DESC'
);
}else{
$args = array(
'post_type'=> 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'order'=>'DESC',
'category_name' => $news_category,
);
}
$result = new WP_Query( $args );
if ( $result-> have_posts() ) :
while ( $result->have_posts() ) : $result->the_post();
$news_thumbnail = get_field('news_thumbnail');
$news_graphic = get_field('news_graphic');
$the_date = get_the_date("F Y");
?>
the_field('news_title'); ?>
the_field('short_description'); ?>
endwhile;
endif; wp_reset_postdata();
?>
elseif (get_row_layout() == 'form') :
$top_padding = get_sub_field('top_padding');
$bottom_padding = get_sub_field('bottom_padding');
$background_colour = get_sub_field('background_colour');
$show_prebuilt_form = get_sub_field('show_prebuilt_form');
$show_contact_details = get_sub_field('show_contact_details');
$form_id = get_sub_field('form_id');
?>
if( get_sub_field('section_title') ): ?>
the_sub_field('section_title'); ?>
endif; ?>
if($show_prebuilt_form=='yes'){
?>
Get in contact
echo do_shortcode('[gravityform id="2" title="false" ajax="false" description="false"]'); ?>
if($show_contact_details=='yes'){
?>
if( have_rows('addresses','options') ):
while( have_rows('addresses','options') ) : the_row();
?>
endwhile;
?>
else :
endif;
}else {
echo 'Just press yes to this for now!';
}
?>
} else {
echo 'This has not been coded yet';
}
?>
endif;
endwhile;
else :
endif;
?>