)?\s*(
)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
//$content = preg_replace('/\s*(*.<\/script>)\s*<\/p>/iU', '\1', $content);
//$content = preg_replace('/\s*(*.<\/iframe>)\s*<\/p>/iU', '\1', $content);
//return $content;
//}
//add_filter( 'the_content', 'remove_some_ptags' );
/* Add Google fonts */
function wpb_add_google_fonts() {
wp_enqueue_style( 'wpb-google-fonts', 'https://fonts.googleapis.com/css?family=Abel:300italic,400italic,700italic,400,700,300', false );
}
add_action( 'wp_enqueue_scripts', 'wpb_add_google_fonts' );
function adrian_the_author_box(){
?>
ID, 'category', array('fields' => 'ids') );
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => 'rand',
'post__not_in' => array ( $post->ID ),
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $custom_taxterms
)
)
);
$related_items = new WP_Query( $args );
if ( $related_items->have_posts() ) {
?>
have_posts() ) : $related_items->the_post(); ?>
ID, 'post_tag', array('fields' => 'ids') );
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => 'rand',
'post__not_in' => array ( $post->ID ),
'tax_query' => array(
array(
'taxonomy' => 'post_tag',
'field' => 'id',
'terms' => $custom_taxterms
)
)
);
$related_items = new WP_Query( $args );
if ( $related_items->have_posts() ) {
?>
have_posts() ) : $related_items->the_post(); ?>
'',
'email' => '',
'url' => ''
);
return $fields;
}
add_filter( 'comment_form_defaults', 'adrian_comment_form_textarea' );
function adrian_comment_form_textarea( $args ) {
$args['comment_field'] = '';
$args['class_submit'] = 'btn btn-default'; // since WP 4.1
return $args;
}
// Custom comments list
function adrian_comment_list( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch( $comment->comment_type ) :
case 'pingback' :
case 'trackback' : ?>
id="comment">
< ?php comment_author_link(); ?>
id="comment-">
class="comment">
'custom_header_checkbox',
'title' => __( 'Header / Footer options', 'adrian-lite' ),
'object_types' => array( 'post','page' ), // Post type
'context' => 'side',
'priority' => 'default',
'show_names' => true, // Show field names on the left
// 'cmb_styles' => false, // false to disable the CMB stylesheet
// 'closed' => true, // Keep the metabox closed by default
) );
$cmb->add_field( array(
'name' => __('Show Custom Header', 'adrian-lite' ),
'desc' => __('Check if you want to disable default header', 'adrian-lite' ),
'id' => $prefix . 'header-checkbox',
'type' => 'checkbox',
) );
$cmb->add_field( array(
'name' => __( 'Header', 'adrian-lite' ),
'desc' => __( 'Select custom header source', 'adrian-lite' ),
'id' => $prefix . 'header',
'type' => 'select',
'options_cb' => 'cmb2_get_custom_blocks_post_type_post_options',
) );
$cmb->add_field( array(
'name' => __('Show Custom Footer', 'adrian-lite' ),
'desc' => __('Check if you want to disable default footer', 'adrian-lite' ),
'id' => $prefix . 'footer-checkbox',
'type' => 'checkbox',
) );
$cmb->add_field( array(
'name' => __( 'Footer', 'adrian-lite' ),
'desc' => __( 'Select custom footer source', 'adrian-lite' ),
'id' => $prefix . 'footer',
'type' => 'select',
'options_cb' => 'cmb2_get_custom_blocks_post_type_post_options',
) );
$cmb->add_field( array(
'name' => 'Scroll Top Color',
'id' => $prefix . 'scroll-top-color',
'type' => 'colorpicker',
'options' => array(
'alpha' => true,
),
) );
}
function cmb2_get_post_options( $query_args ) {
$args = wp_parse_args( $query_args, array(
'post_type' => 'post',
'numberposts' => -1,
) );
$posts = get_posts( $args );
$post_options = array();
if ( $posts ) {
foreach ( $posts as $post ) {
$post_options[ $post->ID ] = $post->post_title;
}
}
return $post_options;
}
function cmb2_get_custom_blocks_post_type_post_options() {
return cmb2_get_post_options( array( 'post_type' => 'cblock', 'numberposts' => -1 ) );
}
// Mega Menu
function megamenu_add_theme_corporate($themes) {
$themes["default"] = array(
'title' => 'default',
'container_background_from' => 'rgba(255, 255, 255, 0)',
'container_background_to' => 'rgba(255, 255, 255, 0)',
'menu_item_align' => 'right',
'menu_item_background_hover_from' => 'rgba(255, 255, 255, 0)',
'menu_item_background_hover_to' => 'rgba(255, 255, 255, 0)',
'menu_item_link_height' => '100px',
'menu_item_link_color' => 'rgb(0, 0, 0)',
'menu_item_link_text_transform' => 'uppercase',
'menu_item_link_color_hover' => 'rgb(246, 235, 20)',
'panel_header_border_color' => '#555',
'panel_font_size' => '14px',
'panel_font_color' => '#666',
'panel_font_family' => 'inherit',
'panel_second_level_font_color' => '#555',
'panel_second_level_font_color_hover' => '#555',
'panel_second_level_text_transform' => 'uppercase',
'panel_second_level_font' => 'inherit',
'panel_second_level_font_size' => '16px',
'panel_second_level_font_weight' => 'bold',
'panel_second_level_font_weight_hover' => 'bold',
'panel_second_level_text_decoration' => 'none',
'panel_second_level_text_decoration_hover' => 'none',
'panel_second_level_border_color' => '#555',
'panel_third_level_font_color' => '#666',
'panel_third_level_font_color_hover' => '#666',
'panel_third_level_font' => 'inherit',
'panel_third_level_font_size' => '14px',
'flyout_link_size' => '14px',
'flyout_link_color' => '#666',
'flyout_link_color_hover' => '#666',
'flyout_link_family' => 'inherit',
'responsive_breakpoint' => '767px',
'transitions' => 'on',
'toggle_background_from' => '#222',
'toggle_background_to' => '#222',
'toggle_font_color' => 'rgb(0, 0, 0)',
'mobile_background_from' => '#222',
'mobile_background_to' => '#222',
'mobile_menu_item_link_font_size' => '14px',
'mobile_menu_item_link_color' => '#ffffff',
'mobile_menu_item_link_text_align' => 'left',
'custom_css' => '/** Push menu onto new line **/
#{$wrap} {
clear: both;
}',
);
return $themes;
}
add_filter("megamenu_themes", "megamenu_add_theme_corporate");