set_permalink_structure( $permalink_structure );
update_option('widget_block',array());
$new_active_widgets = array (
'sidebar-right' => array (
'recent-posts-2',
'related_pages-3',
'child_pages-4',
),
);
// save new widgets to DB
update_option('sidebars_widgets', $new_active_widgets);
add_post_meta(1, 'initial_widget_setup', true);
}
function mod_contact7_form_title( $template ) {
$template->set_title( 'HD Attorney Theme Lead Form' );
return $template;
}
add_filter(
'wpcf7_contact_form_default_pack',
'mod_contact7_form_title'
);
if ( ! function_exists( 'custom_login_logo' ) ) :
function custom_login_logo() {
echo '';
}
endif;
add_action('login_head', 'custom_login_logo');
function general_admin_notice(){
if(!get_post_meta(1, 'hide_initial_setup_notice' , true)){
if(!hd_get_all_index_pages()){
echo '
';
}
}
}
function wp_customize_notice(){
if ( !get_post_meta(1, 'hide_customize_notice' , true)){
echo '';
}
}
add_action('admin_notices', 'wp_customize_notice');
function wp_widgets_notice(){
if ( !get_post_meta(1, 'hide_widgets_notice' , true)){
echo '
Please go to widgets and add "Recent Posts", "Child Pages" and "Related Pages" to the "Sidebar Right" area. Don\'t show again.
';
}
}
add_action('admin_notices', 'wp_widgets_notice');
// Restoring the classic Widgets Editor
function example_theme_support() {
remove_theme_support( 'widgets-block-editor' );
}
add_action( 'after_setup_theme', 'example_theme_support' );
function get_social_media_icons_and_links(){
$socialMedia = array();
if(get_theme_mod('attorney_facebook')){
$socialMedia[] = array(
'link' => get_theme_mod('attorney_facebook'),
'icon' => '',
);
}
if(get_theme_mod('attorney_rss')){
$socialMedia[] = array(
'link' => get_theme_mod('attorney_rss'),
'icon' => '',
);
}
if(get_theme_mod('attorney_instagram')){
$socialMedia[] = array(
'link' => get_theme_mod('attorney_instagram'),
'icon' => '',
);
}
if(get_theme_mod('attorney_linkedin')){
$socialMedia[] = array(
'link' => get_theme_mod('attorney_linkedin'),
'icon' => '',
);
}
if(get_theme_mod('attorney_email')){
$socialMedia[] = array(
'link' => 'mailto:'.get_theme_mod('attorney_email'),
'icon' => '',
);
}
if(get_theme_mod('attorney_twitter')){
$socialMedia[] = array(
'link' => get_theme_mod('attorney_twitter'),
'icon' => '',
);
}
if(get_theme_mod('attorney_yelp')){
$socialMedia[] = array(
'link' => get_theme_mod('attorney_yelp'),
'icon' => '',
);
}
if(get_theme_mod('attorney_youtube')){
$socialMedia[] = array(
'link' => get_theme_mod('attorney_youtube'),
'icon' => '',
);
}
if(get_theme_mod('attorney_tumblr')){
$socialMedia[] = array(
'link' => get_theme_mod('attorney_tumblr'),
'icon' => '',
);
}
return $socialMedia;
}