-
Search Results
-
Another Share.
After reading these posts:
https://kriesi.at/support/topic/open-form-in-a-lightbox-popup/
https://kriesi.at/support/topic/inline-content-in-magnific-popup/
These solutions were difficult.
The current problem with Enfolds is that only certain AVIA LAYOUT BUILDER – LAYOUT ELEMENTS allow for a custom Developer ID.
The issue with each of theses layout elements (Colour Section, Grid Row, Tab Section ) is that they are all full width and interfere with the side bar position. Not good if you are adding a linline popup link. And the popup content has to be inside a ‘Colour Section’.
I should note that you can add a custom ID to a [CODEBLOCK] [/CODEBLOCK], However this didn’t work either as paragraphs <p></p> were stripped from the HTML and replaced with inverted commas “” loosing any paragraph styling.
AVIA LAYOUT BUILDER would be more flexible if we had the ability to add theme support for custom ID on layout elements, the same way you currently add theme support for ‘Custom Css Class’…
add_theme_support('avia_template_builder_custom_css');Any way, I though I would share my quick [SHORTCODE] solution with the community.
Enfolds out of the box already supports lightbox modal windows for videos and images. This solution allows you to display large amounts of formatted text like; terms and conditions, privacy statements, warranty etc. in a lightbox modal window.
Lets get started.
As Magnific Popup is installed natively with Enfolds Theme, we don’t need to load any other assets.
——————————————————————————-
PHP
In your child-theme functions.php file add the following code:/*------------------------------------------------------------------------------- INLINE POP UP ENABLER -------------------------------------------------------------------------------*/ function inline_popup_enabler(){ ?> <script> (function($){ $(window).load(function() { $('.inline_popup').magnificPopup({ type:'inline', midClick: true }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'inline_popup_enabler'); /*------------------------------------------------------------------------------- SHORTCODE - INLINE POST CONTENT POP-UP [mfp_post_popup post_slug_id="" popup_id="" link_text="" custom_class=""] -------------------------------------------------------------------------------*/ function mfp_post_popup_shortcode( $atts ){ //default values extract( shortcode_atts([ 'post_slug_id' => '', 'popup_id' => '', 'link_text' => 'hello', 'mfp_hide' => 'mfp-hide', 'custom_class' => 'mfp_popup_content' ], $atts ) ); //get post content $pop_slug = get_post($post_slug_id); $content = apply_filters( 'the_content', $pop_slug->post_content ); //output post content into the footer before the closing body tag - content is hidden add_action('wp_footer', function() use($content, $popup_id, $mfp_hide, $custom_class) { echo sprintf( '<div id="%s" class="%s %s">%s</div>', $popup_id, $mfp_hide, $custom_class, $content ); }); //output popup link return sprintf( '<a class="inline_popup" href="#%s">%s</a>', $popup_id, $link_text ); } add_shortcode( 'mfp_post_popup', 'mfp_post_popup_shortcode' );——————————————————————————-
CSS
In your child-theme/style.css file add the following CSS:.mfp_popup_content { position: relative; background: #ffffff; padding: 40px; width: auto; max-width: 600px; margin: 100px auto; overflow: auto; }This CSS class is all you need to style the popup window. As this is a custom_class you can change the name of the class in the code or override the default class name by adding custom_class”” to the shortcode. and style to your hearts content. Rounded Corners, Colour Border, Coloured Background etc. etc.
——————————————————————————-
CONTENT
First create a new PAGE or POST with the content you want to display in your popup and publish.
Take note of the post ID, which can be found in the URL address bar at the top of the browser http://domainname.com/wp-adminpost.php?post=——————————————————————————-
SHORTCODE
On your page where you want to popup the content, add the following inline [SHORTCODE]:[mfp_post_popup post_slug_id="" popup_id="" link_text=""]post_slug_id=””
Enter the ID of the post that you want as content in your popup window.
Example:post_slug_id="5"popup_id=””
Enter a custom identifier for the popup. For multiple popup’s on one page, use a different identifier for each popup_id. Don’t use spaces in the ID name. You can use underscore _ and dash – in place of spaces.
Example:popup_id="popup_1"link_text=””
Enter the text ( spaces are allowed ) that will be the active link for the popup.
Example:link_text="open me"EXAMPLE:
Some custom content here with in line link to[mfp_post_popup post_slug_id="5" popup_id="popup_1" link_text="open me"]in a popup window.——————————————————————————-
EXPLINATIONThe code does 3 things:
1. Adds a jQuery script to the footer that enables Magnific popup for elements with a class .inline_popup
2. Creates the active link where the [SHORTCODE] is inserted
<a class=”inline_popup” href=”#popup_id”>link_text</a>3. Creates a hidden div in the footer that contains the content from the post_slug_id
<div id=”popup_id” class=”mfp_hide custom_class”>content</div>——————————————————————————-
TWEAKSYou may find that not all custom theme style colours translate into the magnific popup modal window. However by adding some additional css styles you can target the elements again.
.main_color blockquote { border-color: #c3512f; }Change this by add additional CSS to your child-theme’s style.css file
#top .mfp_popup_content blockquote { border-color: #c3512f; }That’s about it.
Please Share
Hello, i tried to turn on the custom css support for all ALB elements and since then when i try to save/actualize a page in the backend, the page always will show a blank page afterwards (by the way, it saved itself but just leave a blank page, reloading doesn’t help).
I also deleted the css ALB code again from the function.php (enfold and child), restarted the server and the computer, but nothing has helped.
I guess i hasn’t forgotten any code … or added:enfold-child (functions.php):
<?php/*
* Add your own functions here. You can also copy some of the theme functions into this file.
* WordPress will use those functions instead of the original functions then.
*//*m_code Adding Google Font*/
add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
function avia_add_heading_font($fonts)
{
$fonts[‘Merienda’] = ‘Merienda’;
return $fonts;
}add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
function avia_add_content_font($fonts)
{
$fonts[‘Source Sans Pro’] = ‘Source Sans Pro:400,600,800’;
return $fonts;
}?>
enfold-child (functions.php):
<?php
if ( !defined(‘ABSPATH’) ){ die(); }global $avia_config;
/*
* if you run a child theme and dont want to load the default functions.php file
* set the global var below in you childthemes function.php to true:
*
* example: global $avia_config; $avia_config[‘use_child_theme_functions_only’] = true;
* The default functions.php file will then no longer be loaded. You need to make sure then
* to include framework and functions that you want to use by yourself.
*
* This is only recommended for advanced users
*/if(isset($avia_config[‘use_child_theme_functions_only’])) return;
/*
* create a global var which stores the ids of all posts which are displayed on the current page. It will help us to filter duplicate posts
*/
$avia_config[‘posts_on_current_page’] = array();/*
* wpml multi site config file
* needs to be loaded before the framework
*/require_once( ‘config-wpml/config.php’ );
/*
* These are the available color sets in your backend.
* If more sets are added users will be able to create additional color schemes for certain areas
*
* The array key has to be the class name, the value is only used as tab heading on the styling page
*/$avia_config[‘color_sets’] = array(
‘header_color’ => ‘Logo Area’,
‘main_color’ => ‘Main Content’,
‘alternate_color’ => ‘Alternate Content’,
‘footer_color’ => ‘Footer’,
‘socket_color’ => ‘Socket’
);/*
* add support for responsive mega menus
*/add_theme_support(‘avia_mega_menu’);
/*
* add support for improved backend styling
*/add_theme_support(‘avia_improved_backend_style’);
/*
* deactivates the default mega menu and allows us to pass individual menu walkers when calling a menu
*/add_filter(‘avia_mega_menu_walker’, ‘__return_false’);
/*
* adds support for the new avia sidebar manager
*/add_theme_support(‘avia_sidebar_manager’);
/*
* Filters for post formats etc
*/
//add_theme_support(‘avia_queryfilter’);/*
* Register theme text domain
*/
if(!function_exists(‘avia_lang_setup’))
{
add_action(‘after_setup_theme’, ‘avia_lang_setup’);function avia_lang_setup()
{
$lang = apply_filters(‘ava_theme_textdomain_path’, get_template_directory() . ‘/lang’);
load_theme_textdomain(‘avia_framework’, $lang);
}avia_lang_setup();
}/*
function that changes the icon of the theme update tab
*/if(!function_exists(‘avia_theme_update_filter’))
{
function avia_theme_update_filter( $data )
{
if(current_theme_supports(‘avia_improved_backend_style’))
{
$data[‘icon’] = (Email address hidden if logged out) ‘;
}
return $data;
}add_filter(‘avf_update_theme_tab’, ‘avia_theme_update_filter’, 30, 1);
}##################################################################
# AVIA FRAMEWORK by Kriesi# this include calls a file that automatically includes all
# the files within the folder framework and therefore makes
# all functions and classes available for later userequire_once( ‘framework/avia_framework.php’ );
##################################################################
/*
* Register additional image thumbnail sizes
* Those thumbnails are generated on image upload!
*
* If the size of an array was changed after an image was uploaded you either need to re-upload the image
* or use the thumbnail regeneration plugin: http://wordpress.org/extend/plugins/regenerate-thumbnails/
*/$avia_config[‘imgSize’][‘widget’] = array(‘width’=>36, ‘height’=>36); // small preview pics eg sidebar news
$avia_config[‘imgSize’][‘square’] = array(‘width’=>180, ‘height’=>180); // small image for blogs
$avia_config[‘imgSize’][‘featured’] = array(‘width’=>1500, ‘height’=>430 ); // images for fullsize pages and fullsize slider
$avia_config[‘imgSize’][‘featured_large’] = array(‘width’=>1500, ‘height’=>630 ); // images for fullsize pages and fullsize slider
$avia_config[‘imgSize’][‘extra_large’] = array(‘width’=>1500, ‘height’=>1500 , ‘crop’ => false); // images for fullscrren slider
$avia_config[‘imgSize’][‘portfolio’] = array(‘width’=>495, ‘height’=>400 ); // images for portfolio entries (2,3 column)
$avia_config[‘imgSize’][‘portfolio_small’] = array(‘width’=>260, ‘height’=>185 ); // images for portfolio 4 columns
$avia_config[‘imgSize’][‘gallery’] = array(‘width’=>845, ‘height’=>684 ); // images for portfolio entries (2,3 column)
$avia_config[‘imgSize’][‘magazine’] = array(‘width’=>710, ‘height’=>375 ); // images for magazines
$avia_config[‘imgSize’][‘masonry’] = array(‘width’=>705, ‘height’=>705 , ‘crop’ => false); // images for fullscreen masonry
$avia_config[‘imgSize’][‘entry_with_sidebar’] = array(‘width’=>845, ‘height’=>321); // big images for blog and page entries
$avia_config[‘imgSize’][‘entry_without_sidebar’]= array(‘width’=>1210, ‘height’=>423 ); // images for fullsize pages and fullsize slider
$avia_config[‘imgSize’] = apply_filters(‘avf_modify_thumb_size’, $avia_config[‘imgSize’]);$avia_config[‘selectableImgSize’] = array(
‘square’ => __(‘Square’,’avia_framework’),
‘featured’ => __(‘Featured Thin’,’avia_framework’),
‘featured_large’ => __(‘Featured Large’,’avia_framework’),
‘portfolio’ => __(‘Portfolio’,’avia_framework’),
‘gallery’ => __(‘Gallery’,’avia_framework’),
‘entry_with_sidebar’ => __(‘Entry with Sidebar’,’avia_framework’),
‘entry_without_sidebar’ => __(‘Entry without Sidebar’,’avia_framework’),
‘extra_large’ => __(‘Fullscreen Sections/Sliders’,’avia_framework’),);
avia_backend_add_thumbnail_size($avia_config);
if ( ! isset( $content_width ) ) $content_width = $avia_config[‘imgSize’][‘featured’][‘width’];
/*
* register the layout classes
*
*/$avia_config[‘layout’][‘fullsize’] = array(‘content’ => ‘av-content-full alpha’, ‘sidebar’ => ‘hidden’, ‘meta’ => ”,’entry’ => ”);
$avia_config[‘layout’][‘sidebar_left’] = array(‘content’ => ‘av-content-small’, ‘sidebar’ => ‘alpha’ ,’meta’ => ‘alpha’, ‘entry’ => ”);
$avia_config[‘layout’][‘sidebar_right’] = array(‘content’ => ‘av-content-small alpha’,’sidebar’ => ‘alpha’, ‘meta’ => ‘alpha’, ‘entry’ => ‘alpha’);/*
* These are some of the font icons used in the theme, defined by the entypo icon font. the font files are included by the new aviaBuilder
* common icons are stored here for easy retrieval
*/$avia_config[‘font_icons’] = apply_filters(‘avf_default_icons’, array(
//post formats + types
‘standard’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue836’),
‘link’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue822’),
‘image’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue80f’),
‘audio’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue801’),
‘quote’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue833’),
‘gallery’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue80e’),
‘video’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue80d’),
‘portfolio’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue849’),
‘product’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue859’),//social
‘behance’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue915’),
‘dribbble’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8fe’),
‘facebook’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8f3’),
‘flickr’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8ed’),
‘gplus’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8f6’),
‘linkedin’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8fc’),
‘instagram’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue909’),
‘pinterest’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8f8’),
‘skype’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue90d’),
‘tumblr’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8fa’),
‘twitter’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8f1’),
‘vimeo’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8ef’),
‘rss’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue853’),
‘youtube’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue921’),
‘xing’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue923’),
‘soundcloud’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue913’),
‘five_100_px’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue91d’),
‘vk’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue926’),
‘reddit’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue927’),
‘digg’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue928’),
‘delicious’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue929’),
‘mail’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue805’),//woocomemrce
‘cart’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue859’),
‘details’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue84b’),//bbpress
‘supersticky’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue808’),
‘sticky’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue809’),
‘one_voice’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue83b’),
‘multi_voice’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue83c’),
‘closed’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue824’),
‘sticky_closed’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue808\ue824’),
‘supersticky_closed’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue809\ue824’),//navigation, slider & controls
‘play’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue897’),
‘pause’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue899’),
‘next’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue879’),
‘prev’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue878’),
‘next_big’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue87d’),
‘prev_big’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue87c’),
‘close’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue814’),
‘reload’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue891’),
‘mobile_menu’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8a5’),//image hover overlays
‘ov_external’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue832’),
‘ov_image’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue869’),
‘ov_video’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue897’),//misc
‘search’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue803’),
‘info’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue81e’),
‘clipboard’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8d1’),
‘scrolltop’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue876’),
‘scrolldown’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue877’),
‘bitcoin’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue92a’),));
add_theme_support( ‘automatic-feed-links’ );
##################################################################
# Frontend Stuff necessary for the theme:
##################################################################/*
* Register frontend javascripts:
*/
if(!function_exists(‘avia_register_frontend_scripts’))
{
if(!is_admin()){
add_action(‘wp_enqueue_scripts’, ‘avia_register_frontend_scripts’);
}function avia_register_frontend_scripts()
{
$template_url = get_template_directory_uri();
$child_theme_url = get_stylesheet_directory_uri();//register js
wp_enqueue_script( ‘avia-compat’, $template_url.’/js/avia-compat.js’, array(‘jquery’), 2, false ); //needs to be loaded at the top to prevent bugs
wp_enqueue_script( ‘avia-default’, $template_url.’/js/avia.js’, array(‘jquery’), 3, true );
wp_enqueue_script( ‘avia-shortcodes’, $template_url.’/js/shortcodes.js’, array(‘jquery’), 3, true );
wp_enqueue_script( ‘avia-popup’, $template_url.’/js/aviapopup/jquery.magnific-popup.min.js’, array(‘jquery’), 2, true);wp_enqueue_script( ‘jquery’ );
wp_enqueue_script( ‘wp-mediaelement’ );if ( is_singular() && get_option( ‘thread_comments’ ) ) { wp_enqueue_script( ‘comment-reply’ ); }
//register styles
wp_register_style( ‘avia-style’ , $child_theme_url.”/style.css”, array(), ‘2’, ‘all’ ); //register default style.css file. only include in childthemes. has no purpose in main theme
wp_register_style( ‘avia-custom’, $template_url.”/css/custom.css”, array(), ‘2’, ‘all’ );wp_enqueue_style( ‘avia-grid’ , $template_url.”/css/grid.css”, array(), ‘2’, ‘all’ );
wp_enqueue_style( ‘avia-base’ , $template_url.”/css/base.css”, array(), ‘2’, ‘all’ );
wp_enqueue_style( ‘avia-layout’, $template_url.”/css/layout.css”, array(), ‘2’, ‘all’ );
wp_enqueue_style( ‘avia-scs’, $template_url.”/css/shortcodes.css”, array(), ‘2’, ‘all’ );
wp_enqueue_style( ‘avia-popup-css’, $template_url.”/js/aviapopup/magnific-popup.css”, array(), ‘1’, ‘screen’ );
wp_enqueue_style( ‘avia-media’ , $template_url.”/js/mediaelement/skin-1/mediaelementplayer.css”, array(), ‘1’, ‘screen’ );
wp_enqueue_style( ‘avia-print’ , $template_url.”/css/print.css”, array(), ‘1’, ‘print’ );if ( is_rtl() ) {
wp_enqueue_style( ‘avia-rtl’, $template_url.”/css/rtl.css”, array(), ‘1’, ‘all’ );
}global $avia;
$safe_name = avia_backend_safe_string($avia->base_data[‘prefix’]);
$safe_name = apply_filters(‘avf_dynamic_stylesheet_filename’, $safe_name);if( get_option(‘avia_stylesheet_exists’.$safe_name) == ‘true’ )
{
$avia_upload_dir = wp_upload_dir();
if(is_ssl()) $avia_upload_dir[‘baseurl’] = str_replace(“http://”, “https://”, $avia_upload_dir[‘baseurl’]);$avia_dyn_stylesheet_url = $avia_upload_dir[‘baseurl’] . ‘/dynamic_avia/’.$safe_name.’.css’;
$version_number = get_option(‘avia_stylesheet_dynamic_version’.$safe_name);
if(empty($version_number)) $version_number = ‘1’;wp_enqueue_style( ‘avia-dynamic’, $avia_dyn_stylesheet_url, array(), $version_number, ‘all’ );
}wp_enqueue_style( ‘avia-custom’);
if($child_theme_url != $template_url)
{
wp_enqueue_style( ‘avia-style’);
}}
}if(!function_exists(‘avia_remove_default_video_styling’))
{
if(!is_admin()){
add_action(‘wp_footer’, ‘avia_remove_default_video_styling’, 1);
}function avia_remove_default_video_styling()
{
//remove default style for videos
wp_dequeue_style( ‘mediaelement’ );
// wp_dequeue_script( ‘wp-mediaelement’ );
// wp_dequeue_style( ‘wp-mediaelement’ );
}
}/*
* Activate native wordpress navigation menu and register a menu location
*/
if(!function_exists(‘avia_nav_menus’))
{
function avia_nav_menus()
{
global $avia_config, $wp_customize;add_theme_support(‘nav_menus’);
foreach($avia_config[‘nav_menus’] as $key => $value)
{
//wp-admin\customize.php does not support html code in the menu description – thus we need to strip it
$name = (!empty($value[‘plain’]) && !empty($wp_customize)) ? $value[‘plain’] : $value[‘html’];
register_nav_menu($key, THEMENAME.’ ‘.$name);
}
}$avia_config[‘nav_menus’] = array( ‘avia’ => array(‘html’ => __(‘Main Menu’, ‘avia_framework’)),
‘avia2’ => array(
‘html’ => ”.__(‘Secondary Menu’, ‘avia_framework’).’ <br/><small>(‘.__(‘Will be displayed if you selected a header layout that supports a submenu’, ‘avia_framework’).’ ‘.__(‘here’, ‘avia_framework’).’)</small>’,
‘plain’=> __(‘Secondary Menu – will be displayed if you selected a header layout that supports a submenu’, ‘avia_framework’)),
‘avia3’ => array(
‘html’ => __(‘Footer Menu <br/><small>(no dropdowns)</small>’, ‘avia_framework’),
‘plain’=> __(‘Footer Menu (no dropdowns)’, ‘avia_framework’))
);avia_nav_menus(); //call the function immediatly to activate
}/*
* load some frontend functions in folder include:
*/require_once( ‘includes/admin/register-portfolio.php’ ); // register custom post types for portfolio entries
require_once( ‘includes/admin/register-widget-area.php’ ); // register sidebar widgets for the sidebar and footer
require_once( ‘includes/loop-comments.php’ ); // necessary to display the comments properly
require_once( ‘includes/helper-template-logic.php’ ); // holds the template logic so the theme knows which tempaltes to use
require_once( ‘includes/helper-social-media.php’ ); // holds some helper functions necessary for twitter and facebook buttons
require_once( ‘includes/helper-post-format.php’ ); // holds actions and filter necessary for post formats
require_once( ‘includes/helper-markup.php’ ); // holds the markup logic (schema.org and html5)if(current_theme_supports(‘avia_conditionals_for_mega_menu’))
{
require_once( ‘includes/helper-conditional-megamenu.php’ ); // holds the walker for the responsive mega menu
}require_once( ‘includes/helper-responsive-megamenu.php’ ); // holds the walker for the responsive mega menu
//adds the plugin initalization scripts that add styles and functions
if(!current_theme_supports(‘deactivate_layerslider’)) require_once( ‘config-layerslider/config.php’ );//layerslider plugin
require_once( ‘config-bbpress/config.php’ ); //compatibility with bbpress forum plugin
require_once( ‘config-templatebuilder/config.php’ ); //templatebuilder plugin
require_once( ‘config-gravityforms/config.php’ ); //compatibility with gravityforms plugin
require_once( ‘config-woocommerce/config.php’ ); //compatibility with woocommerce plugin
require_once( ‘config-wordpress-seo/config.php’ ); //compatibility with Yoast WordPress SEO pluginif(!current_theme_supports(‘deactivate_tribe_events_calendar’))
{
require_once( ‘config-events-calendar/config.php’ ); //compatibility with the Events Calendar plugin
}if(is_admin())
{
require_once( ‘includes/admin/helper-compat-update.php’); // include helper functions for new versions
}/*
* dynamic styles for front and backend
*/
if(!function_exists(‘avia_custom_styles’))
{
function avia_custom_styles()
{
require_once( ‘includes/admin/register-dynamic-styles.php’ ); // register the styles for dynamic frontend styling
avia_prepare_dynamic_styles();
}add_action(‘init’, ‘avia_custom_styles’, 20);
add_action(‘admin_init’, ‘avia_custom_styles’, 20);
}/*
* activate framework widgets
*/
if(!function_exists(‘avia_register_avia_widgets’))
{
function avia_register_avia_widgets()
{
register_widget( ‘avia_newsbox’ );
register_widget( ‘avia_portfoliobox’ );
register_widget( ‘avia_socialcount’ );
register_widget( ‘avia_combo_widget’ );
register_widget( ‘avia_partner_widget’ );
register_widget( ‘avia_google_maps’ );
register_widget( ‘avia_fb_likebox’ );
register_widget( ‘avia_instagram_widget’ );}
avia_register_avia_widgets(); //call the function immediatly to activate
}/*
* add post format options
*/
add_theme_support( ‘post-formats’, array(‘link’, ‘quote’, ‘gallery’,’video’,’image’,’audio’ ) );/*
* Remove the default shortcode function, we got new ones that are better ;)
*/
add_theme_support( ‘avia-disable-default-shortcodes’, true);/*
* compat mode for easier theme switching from one avia framework theme to another
*/
add_theme_support( ‘avia_post_meta_compat’);/*
* make sure that enfold widgets dont use the old slideshow parameter in widgets, but default post thumbnails
*/
add_theme_support(‘force-post-thumbnails-in-widget’);/*
* display page titles via wordpress default output
*/
function av_theme_slug_setup()
{
add_theme_support( ‘title-tag’ );
}add_action( ‘after_setup_theme’, ‘av_theme_slug_setup’ );
/*title fallback*/
if ( ! function_exists( ‘_wp_render_title_tag’ ) )
{
function av_theme_slug_render_title()
{
echo “<title>” . avia_set_title_tag() .”</title>”;
}
add_action( ‘wp_head’, ‘av_theme_slug_render_title’ );
}/*
* register custom functions that are not related to the framework but necessary for the theme to run
*/require_once( ‘functions-enfold.php’);
/*
* add option to edit elements via css class
*/
// add_theme_support(‘avia_template_builder_custom_css’);Topic: please help me out
Hello,
I run into a problem. I’m trying to add a custom css section to my element builder.
I saw documantation about it and I follow the steps but it dont work.When I paste this line: add_theme_support(‘avia_template_builder_custom_css’); into my functions.php nothing happens. Maybe can you guys help me out what the problem is.
This is my function.php page:<?php
global $avia_config;
/*
* if you run a child theme and dont want to load the default functions.php file
* set the global var below in you childthemes function.php to true:
*
* example: global $avia_config; $avia_config[‘use_child_theme_functions_only’] = true;
* The default functions.php file will then no longer be loaded. You need to make sure then
* to include framework and functions that you want to use by yourself.
*
* This is only recommended for advanced users
*/if(isset($avia_config[‘use_child_theme_functions_only’])) return;
/*
* create a global var which stores the ids of all posts which are displayed on the current page. It will help us to filter duplicate posts
*/
$avia_config[‘posts_on_current_page’] = array();/*
* wpml multi site config file
* needs to be loaded before the framework
*/require_once( ‘config-wpml/config.php’ );
/*
* These are the available color sets in your backend.
* If more sets are added users will be able to create additional color schemes for certain areas
*
* The array key has to be the class name, the value is only used as tab heading on the styling page
*/$avia_config[‘color_sets’] = array(
‘header_color’ => ‘Logo Area’,
‘main_color’ => ‘Main Content’,
‘alternate_color’ => ‘Alternate Content’,
‘footer_color’ => ‘Footer’,
‘socket_color’ => ‘Socket’
);/*
* add support for responsive mega menus
*/add_theme_support(‘avia_mega_menu’);
/*
* deactivates the default mega menu and allows us to pass individual menu walkers when calling a menu
*/add_filter(‘avia_mega_menu_walker’, ‘__return_false’);
/*
* adds support for the new avia sidebar manager
*/add_theme_support(‘avia_sidebar_manager’);
/*
* Filters for post formats etc
*/
//add_theme_support(‘avia_queryfilter’);/*
* Register theme text domain
*/
if(!function_exists(‘avia_lang_setup’))
{
add_action(‘after_setup_theme’, ‘avia_lang_setup’);
function avia_lang_setup()
{
$lang = apply_filters(‘ava_theme_textdomain_path’, get_template_directory() . ‘/lang’);
load_theme_textdomain(‘avia_framework’, $lang);
}
avia_lang_setup();
}##################################################################
# AVIA FRAMEWORK by Kriesi# this include calls a file that automatically includes all
# the files within the folder framework and therefore makes
# all functions and classes available for later userequire_once( ‘framework/avia_framework.php’ );
##################################################################
/*
* Register additional image thumbnail sizes
* Those thumbnails are generated on image upload!
*
* If the size of an array was changed after an image was uploaded you either need to re-upload the image
* or use the thumbnail regeneration plugin: http://wordpress.org/extend/plugins/regenerate-thumbnails/
*/$avia_config[‘imgSize’][‘widget’]
= array(‘width’=>36, ‘height’=>36);
// small preview pics eg sidebar news
$avia_config[‘imgSize’][‘square’]
= array(‘width’=>180, ‘height’=>180);
// small image for blogs
$avia_config[‘imgSize’][‘featured’]
= array(‘width’=>1500, ‘height’=>430 );
// images for fullsize pages and fullsize slider
$avia_config[‘imgSize’][‘featured_large’]
= array(‘width’=>1500, ‘height’=>630 );
// images for fullsize pages and fullsize slider
$avia_config[‘imgSize’][‘extra_large’]
= array(‘width’=>1500, ‘height’=>1500 , ‘crop’ => false);
// images for fullscrren slider
$avia_config[‘imgSize’][‘portfolio’]
= array(‘width’=>495, ‘height’=>400 );
// images for portfolio entries (2,3 column)
$avia_config[‘imgSize’][‘portfolio_small’]
= array(‘width’=>260, ‘height’=>185 );
// images for portfolio 4 columns
$avia_config[‘imgSize’][‘gallery’]
= array(‘width’=>845, ‘height’=>684 );
// images for portfolio entries (2,3 column)
$avia_config[‘imgSize’][‘magazine’]
= array(‘width’=>710, ‘height’=>375 );
// images for magazines
$avia_config[‘imgSize’][‘masonry’]
= array(‘width’=>705, ‘height’=>705 , ‘crop’ => false);
// images for fullscreen masonry
$avia_config[‘imgSize’][‘entry_with_sidebar’]
= array(‘width’=>845, ‘height’=>321);
// big images for blog and page entries
$avia_config[‘imgSize’][‘entry_without_sidebar’]= array(‘width’=>1210, ‘height’=>423 );
// images for fullsize pages and fullsize slider
$avia_config[‘imgSize’] = apply_filters(‘avf_modify_thumb_size’, $avia_config[‘imgSize’]);$avia_config[‘selectableImgSize’] = array(
‘square’
=> __(‘Square’,’avia_framework’),
‘featured’
=> __(‘Featured Thin’,’avia_framework’),
‘featured_large’
=> __(‘Featured Large’,’avia_framework’),
‘portfolio’
=> __(‘Portfolio’,’avia_framework’),
‘gallery’
=> __(‘Gallery’,’avia_framework’),
‘entry_with_sidebar’ => __(‘Entry with Sidebar’,’avia_framework’),
‘entry_without_sidebar’
=> __(‘Entry without Sidebar’,’avia_framework’),
‘extra_large’
=> __(‘Fullscreen Sections/Sliders’,’avia_framework’),
);avia_backend_add_thumbnail_size($avia_config);
if ( ! isset( $content_width ) ) $content_width = $avia_config[‘imgSize’][‘featured’][‘width’];
/*
* register the layout classes
*
*/$avia_config[‘layout’][‘fullsize’]
= array(‘content’ => ‘av-content-full alpha’, ‘sidebar’ => ‘hidden’,
‘meta’ => ”,’entry’ => ”);
$avia_config[‘layout’][‘sidebar_left’]
= array(‘content’ => ‘av-content-small’,
‘sidebar’ => ‘alpha’ ,’meta’ => ‘alpha’, ‘entry’ => ”);
$avia_config[‘layout’][‘sidebar_right’] = array(‘content’ => ‘av-content-small alpha’,’sidebar’ => ‘alpha’, ‘meta’ => ‘alpha’, ‘entry’ => ‘alpha’);/*
* These are some of the font icons used in the theme, defined by the entypo icon font. the font files are included by the new aviaBuilder
* common icons are stored here for easy retrieval
*/$avia_config[‘font_icons’] = apply_filters(‘avf_default_icons’, array(
//post formats + types
‘standard’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue836’),
‘link’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue822’),
‘image’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue80f’),
‘audio’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue801’),
‘quote’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue833’),
‘gallery’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue80e’),
‘video’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue80d’),
‘portfolio’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue849’),
‘product’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue859’),//social
‘behance’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue915’),
‘dribbble’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8fe’),
‘facebook’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8f3’),
‘flickr’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8ed’),
‘gplus’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8f6’),
‘linkedin’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8fc’),
‘instagram’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue909’),
‘pinterest’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8f8’),
‘skype’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue90d’),
‘tumblr’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8fa’),
‘twitter’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8f1’),
‘vimeo’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8ef’),
‘rss’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue853’),
‘youtube’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue921’),
‘xing’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue923’),
‘soundcloud’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue913’),
‘five_100_px’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue91d’),
‘vk’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue926’),
‘reddit’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue927’),
‘digg’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue928’),
‘delicious’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue929’),
‘mail’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue805’),
//woocomemrce
‘cart’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue859’),
‘details’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue84b’),//bbpress
‘supersticky’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue808’),
‘sticky’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue809’),
‘one_voice’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue83b’),
‘multi_voice’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue83c’),
‘closed’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue824’),
‘sticky_closed’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue808\ue824’),
‘supersticky_closed’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue809\ue824’),
//navigation, slider & controls
‘play’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue897’),
‘pause’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue899’),
‘next’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue879’),
‘prev’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue878’),
‘next_big’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue87d’),
‘prev_big’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue87c’),
‘close’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue814’),
‘reload’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue891’),
‘mobile_menu’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8a5’),
//image hover overlays
‘ov_external’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue832’),
‘ov_image’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue869’),
‘ov_video’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue897’),//misc
‘search’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue803’),
‘info’ => array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue81e’),
‘clipboard’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8d1’),
‘scrolltop’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue876’),
‘scrolldown’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue877’),
‘bitcoin’
=> array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue92a’),));
add_theme_support( ‘automatic-feed-links’ );
##################################################################
# Frontend Stuff necessary for the theme:
##################################################################/*
* Register frontend javascripts:
*/
if(!function_exists(‘avia_register_frontend_scripts’))
{
if(!is_admin()){
add_action(‘wp_enqueue_scripts’, ‘avia_register_frontend_scripts’);
}function avia_register_frontend_scripts()
{
$template_url = get_template_directory_uri();
$child_theme_url = get_stylesheet_directory_uri();//register js
wp_enqueue_script( ‘avia-compat’, $template_url.’/js/avia-compat.js’, array(‘jquery’), 2, false ); //needs to be loaded at the top to prevent bugs
wp_enqueue_script( ‘avia-default’, $template_url.’/js/avia.js’, array(‘jquery’), 3, true );
wp_enqueue_script( ‘avia-shortcodes’, $template_url.’/js/shortcodes.js’, array(‘jquery’), 3, true );
wp_enqueue_script( ‘avia-popup’, $template_url.’/js/aviapopup/jquery.magnific-popup.min.js’, array(‘jquery’), 2, true);wp_enqueue_script( ‘jquery’ );
wp_enqueue_script( ‘wp-mediaelement’ );if ( is_singular() && get_option( ‘thread_comments’ ) ) { wp_enqueue_script( ‘comment-reply’ ); }
//register styles
wp_register_style( ‘avia-style’ , $child_theme_url.”/style.css”, array(), ‘2’, ‘all’ ); //register default style.css file. only include in childthemes. has no purpose in main theme
wp_register_style( ‘avia-custom’, $template_url.”/css/custom.css”, array(), ‘2’, ‘all’ );wp_enqueue_style( ‘avia-grid’ , $template_url.”/css/grid.css”, array(), ‘2’, ‘all’ );
wp_enqueue_style( ‘avia-base’ , $template_url.”/css/base.css”, array(), ‘2’, ‘all’ );
wp_enqueue_style( ‘avia-layout’, $template_url.”/css/layout.css”, array(), ‘2’, ‘all’ );
wp_enqueue_style( ‘avia-scs’, $template_url.”/css/shortcodes.css”, array(), ‘2’, ‘all’ );
wp_enqueue_style( ‘avia-popup-css’, $template_url.”/js/aviapopup/magnific-popup.css”, array(), ‘1’, ‘screen’ );
wp_enqueue_style( ‘avia-media’ , $template_url.”/js/mediaelement/skin-1/mediaelementplayer.css”, array(), ‘1’, ‘screen’ );
wp_enqueue_style( ‘avia-print’ , $template_url.”/css/print.css”, array(), ‘1’, ‘print’ );
if ( is_rtl() ) {
wp_enqueue_style( ‘avia-rtl’, $template_url.”/css/rtl.css”, array(), ‘1’, ‘all’ );
}global $avia;
$safe_name = avia_backend_safe_string($avia->base_data[‘prefix’]);
$safe_name = apply_filters(‘avf_dynamic_stylesheet_filename’, $safe_name);if( get_option(‘avia_stylesheet_exists’.$safe_name) == ‘true’ )
{
$avia_upload_dir = wp_upload_dir();
if(is_ssl()) $avia_upload_dir[‘baseurl’] = str_replace(“http://”, “https://”, $avia_upload_dir[‘baseurl’]);$avia_dyn_stylesheet_url = $avia_upload_dir[‘baseurl’] . ‘/dynamic_avia/’.$safe_name.’.css’;
$version_number = get_option(‘avia_stylesheet_dynamic_version’.$safe_name);
if(empty($version_number)) $version_number = ‘1’;wp_enqueue_style( ‘avia-dynamic’, $avia_dyn_stylesheet_url, array(), $version_number, ‘all’ );
}wp_enqueue_style( ‘avia-custom’);
if($child_theme_url != $template_url)
{
wp_enqueue_style( ‘avia-style’);
}}
}if(!function_exists(‘avia_remove_default_video_styling’))
{
if(!is_admin()){
add_action(‘wp_footer’, ‘avia_remove_default_video_styling’, 1);
}function avia_remove_default_video_styling()
{
//remove default style for videos
wp_dequeue_style( ‘mediaelement’ );
// wp_dequeue_script( ‘wp-mediaelement’ );
// wp_dequeue_style( ‘wp-mediaelement’ );
}
}/*
* Activate native wordpress navigation menu and register a menu location
*/
if(!function_exists(‘avia_nav_menus’))
{
function avia_nav_menus()
{
global $avia_config, $wp_customize;add_theme_support(‘nav_menus’);
foreach($avia_config[‘nav_menus’] as $key => $value)
{
//wp-admin\customize.php does not support html code in the menu description – thus we need to strip it
$name = (!empty($value[‘plain’]) && !empty($wp_customize)) ? $value[‘plain’] : $value[‘html’];
register_nav_menu($key, THEMENAME.’ ‘.$name);
}
}$avia_config[‘nav_menus’] = array(
‘avia’ => array(‘html’ => __(‘Main Menu’, ‘avia_framework’)),
‘avia2’ => array(
‘html’ => __(‘Secondary Menu <br/><small>(Will be displayed if you selected a header layout that supports a submenu here)</small>’, ‘avia_framework’),
‘plain’=> __(‘Secondary Menu – will be displayed if you selected a header layout that supports a submenu’, ‘avia_framework’)),
‘avia3’ => array(
‘html’ => __(‘Footer Menu <br/><small>(no dropdowns)</small>’, ‘avia_framework’),
‘plain’=> __(‘Footer Menu (no dropdowns)’, ‘avia_framework’))
);avia_nav_menus(); //call the function immediatly to activate
}/*
* load some frontend functions in folder include:
*/require_once( ‘includes/admin/register-portfolio.php’ );
// register custom post types for portfolio entries
require_once( ‘includes/admin/register-widget-area.php’ );
// register sidebar widgets for the sidebar and footer
require_once( ‘includes/loop-comments.php’ );
// necessary to display the comments properly
require_once( ‘includes/helper-template-logic.php’ );
// holds the template logic so the theme knows which tempaltes to use
require_once( ‘includes/helper-social-media.php’ );
// holds some helper functions necessary for twitter and facebook buttons
require_once( ‘includes/helper-post-format.php’ );
// holds actions and filter necessary for post formats
require_once( ‘includes/helper-markup.php’ );
// holds the markup logic (schema.org and html5)if(current_theme_supports(‘avia_conditionals_for_mega_menu’))
{
require_once( ‘includes/helper-conditional-megamenu.php’ ); // holds the walker for the responsive mega menu
}require_once( ‘includes/helper-responsive-megamenu.php’ );
// holds the walker for the responsive mega menu//adds the plugin initalization scripts that add styles and functions
if(!current_theme_supports(‘deactivate_layerslider’)) require_once( ‘config-layerslider/config.php’ );//layerslider plugin
require_once( ‘config-bbpress/config.php’ );
//compatibility with bbpress forum plugin
require_once( ‘config-templatebuilder/config.php’ );
//templatebuilder plugin
require_once( ‘config-gravityforms/config.php’ );
//compatibility with gravityforms plugin
require_once( ‘config-woocommerce/config.php’ );
//compatibility with woocommerce plugin
require_once( ‘config-wordpress-seo/config.php’ );
//compatibility with Yoast WordPress SEO pluginif(!current_theme_supports(‘deactivate_tribe_events_calendar’))
{
require_once( ‘config-events-calendar/config.php’ );
//compatibility with the Events Calendar plugin
}if(is_admin())
{
require_once( ‘includes/admin/helper-compat-update.php’);
// include helper functions for new versions
}/*
* dynamic styles for front and backend
*/
if(!function_exists(‘avia_custom_styles’))
{
function avia_custom_styles()
{
require_once( ‘includes/admin/register-dynamic-styles.php’ );
// register the styles for dynamic frontend styling
avia_prepare_dynamic_styles();
}add_action(‘init’, ‘avia_custom_styles’, 20);
add_action(‘admin_init’, ‘avia_custom_styles’, 20);
}/*
* activate framework widgets
*/
if(!function_exists(‘avia_register_avia_widgets’))
{
function avia_register_avia_widgets()
{
register_widget( ‘avia_newsbox’ );
register_widget( ‘avia_portfoliobox’ );
register_widget( ‘avia_socialcount’ );
register_widget( ‘avia_combo_widget’ );
register_widget( ‘avia_partner_widget’ );
register_widget( ‘avia_google_maps’ );
register_widget( ‘avia_fb_likebox’ );
register_widget( ‘avia_instagram_widget’ );
}avia_register_avia_widgets(); //call the function immediatly to activate
}/*
* add post format options
*/
add_theme_support( ‘post-formats’, array(‘link’, ‘quote’, ‘gallery’,’video’,’image’,’audio’ ) );/*
* Remove the default shortcode function, we got new ones that are better ;)
*/
add_theme_support( ‘avia-disable-default-shortcodes’, true);/*
* compat mode for easier theme switching from one avia framework theme to another
*/
add_theme_support( ‘avia_post_meta_compat’);/*
* make sure that enfold widgets dont use the old slideshow parameter in widgets, but default post thumbnails
*/
add_theme_support(‘force-post-thumbnails-in-widget’);/*
* register custom functions that are not related to the framework but necessary for the theme to run
*/require_once( ‘functions-enfold.php’);
/*
* add option to edit elements via css class
*/add_theme_support(‘avia_template_builder_custom_css’);
————————————————
I hope to hear from you guys soon!
Hi
I’d like to say how much I am enjoying using the Enfold theme, and how impressive your tech support is!I’m trying to do two customisations on the Color Selection with a back ground Image. Unrtunately I’m developing locally, so can’t provide access.
Here’s the element from the page
<div id="castiletop" class="avia-section header_color avia-section-small avia-no-border-styling av-section-color-overlay-active avia-bg-style-scroll avia-builder-el-0 el_before_av_section avia-builder-el-first myname av-minimum-height av-minimum-height-custom container_wrap fullsize" style="background-repeat: no-repeat; background-image: url(https://tcs-japan-new:8888/wp-content/uploads/2016/11/The-Camel-Soap-Factory-Pure-and-Natural-Camel-Milk-Soap-1-4.jpg); background-attachment: scroll; background-position: center left; " data-section-bg-repeat="no-repeat"><div class="av-section-color-overlay-wrap"><div class="av-section-color-overlay" style="opacity: 0.5; background-color: #ffffff; "></div><div class="container" style="height:500px"><main role="main" itemprop="mainContentOfPage" class="template-page content av-content-full alpha units"><div class="post-entry post-entry-type-page post-entry-39"><div class="entry-content-wrapper clearfix">I ‘ve implemented avia_template_builder_custom_css and have given it a name (myname) as well as giving the id (castiletop)
So, two questions:
1. I’d like to ‘nudge’ the background image say 20px to the right – as a temporary solution I’ve added whitespace to the actual image, but this is not suitable on smaller screens. can this be done ?
2. The code shows that I have a white overlay @ 50%, however I would like this overlay to appear only on smaller screens (mobile ..> )With Thanks
DaveHi,
I am getting this error message below when trying to update Plugins. This is after updating to most recent version of WordPress. Then I got the login screen that said WP Database was out of date. That went fine. But now I can’t update Plugins:
Update Failed: <!DOCTYPE html> <!–[if IE 8]> <![endif]–> <!–[if !(IE 8) ]><!–> <!–<![endif]–> LiveSite Pack ‹ Rosewood Virtual Admin — WordPress addLoadEvent = function(func){if(typeof jQuery!=”undefined”)jQuery(document).ready(func);else if(typeof wpOnload!=’function’){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; var ajaxurl = ‘/wp-admin/admin-ajax.php’, pagenow = ‘toplevel_page_live-site’, typenow = ”, adminpage = ‘toplevel_page_live-site’, thousandsSeparator = ‘,’, decimalPoint = ‘.’, isRtl = 0; img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } <!–[if lte IE 7]> <![endif]–> window._wpemojiSettings = {“baseUrl”:”https:\/\/s.w.org\/images\/core\/emoji\/2\/72×72\/”,”ext”:”.png”,”svgUrl”:”https:\/\/s.w.org\/images\/core\/emoji\/2\/svg\/”,”svgExt”:”.svg”,”source”:{“concatemoji”:”http:\/\/rosewoodva.ca\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.6.1″}}; !function(a,b,c){function d(a){var c,d,e,f,g,h=b.createElement(“canvas”),i=h.getContext&&h.getContext(“2d”),j=String.fromCharCode;if(!i||!i.fillText)return!1;switch(i.textBaseline=”top”,i.font=”600 32px Arial”,a){case”flag”:return i.fillText(j(55356,56806,55356,56826),0,0),!(h.toDataURL().length<3e3)&&(i.clearRect(0,0,h.width,h.height),i.fillText(j(55356,57331,65039,8205,55356,57096),0,0),c=h.toDataURL(),i.clearRect(0,0,h.width,h.height),i.fillText(j(55356,57331,55356,57096),0,0),d=h.toDataURL(),c!==d);case”diversity”:return i.fillText(j(55356,57221),0,0),e=i.getImageData(16,16,1,1).data,f=e[0]+”,”+e[1]+”,”+e[2]+”,”+e[3],i.fillText(j(55356,57221,55356,57343),0,0),e=i.getImageData(16,16,1,1).data,g=e[0]+”,”+e[1]+”,”+e[2]+”,”+e[3],f!==g;case”simple”:return i.fillText(j(55357,56835),0,0),0!==i.getImageData(16,16,1,1).data[0];case”unicode8″:return i.fillText(j(55356,57135),0,0),0!==i.getImageData(16,16,1,1).data[0];case”unicode9″:return i.fillText(j(55358,56631),0,0),0!==i.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement(“script”);c.src=a,c.type=”text/javascript”,b.getElementsByTagName(“head”)[0].appendChild(c)}var f,g,h,i;for(i=Array(“simple”,”flag”,”unicode8″,”diversity”,”unicode9″),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],”flag”!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener(“DOMContentLoaded”,g,!1),a.addEventListener(“load”,g,!1)):(a.attachEvent(“onload”,g),b.attachEvent(“onreadystatechange”,function(){“complete”===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings); /* <![CDATA[ */ var avia_framework_globals = avia_framework_globals || {}; avia_framework_globals.frameworkUrl = ‘http://rosewoodva.ca/wp-content/themes/enfold-test/framework/’; avia_framework_globals.installedAt = ‘http://rosewoodva.ca/wp-content/themes/enfold-test/’; avia_framework_globals.ajaxurl = ‘http://rosewoodva.ca/wp-admin/admin-ajax.php’; /* ]]> */ /* <![CDATA[ */ var AtD_l10n_r0ar = {“menu_title_spelling”:”Spelling”,”menu_title_repeated_word”:”Repeated Word”,”menu_title_no_suggestions”:”No suggestions”,”menu_option_explain”:”Explain…”,”menu_option_ignore_once”:”Ignore suggestion”,”menu_option_ignore_always”:”Ignore always”,”menu_option_ignore_all”:”Ignore all”,”menu_option_edit_selection”:”Edit Selection…”,”button_proofread”:”proofread”,”button_edit_text”:”edit text”,”button_proofread_tooltip”:”Proofread Writing”,”message_no_errors_found”:”No writing errors were found.”,”message_server_error”:”There was a problem communicating with the Proofreading service. Try again in one minute.”,”message_server_error_short”:”There was an error communicating with the proofreading service.”,”dialog_replace_selection”:”Replace selection with:”,”dialog_confirm_post_publish”:”The proofreader has suggestions for this post. Are you sure you want to publish it?\n\nPress OK to publish your post, or Cancel to view the suggestions and edit your post.”,”dialog_confirm_post_update”:”The proofreader has suggestions for this post. Are you sure you want to update it?\n\nPress OK to update your post, or Cancel to view the suggestions and edit your post.”}; /* ]]> */ /* <![CDATA[ */ var ls_PHPVAR_livesite = {“ls_admin_url”:”http:\/\/rosewoodva.ca\/wp-admin\/”,”ls_locale”:”en_US”,”ls_module_nonce”:”bd8e0a3374″,”ls_site_url”:”http:\/\/rosewoodva.ca”}; /* ]]> */ /* <![CDATA[ */ var userSettings = {“url”:”\/”,”uid”:”1″,”time”:”1477593071″,”secure”:””};var quicktagsL10n = {“closeAllOpenTags”:”Close all open tags”,”closeTags”:”close tags”,”enterURL”:”Enter the URL”,”enterImageURL”:”Enter the URL of the image”,”enterImageDescription”:”Enter a description of the image”,”textdirection”:”text direction”,”toggleTextdirection”:”Toggle Editor Text Direction”,”dfw”:”Distraction-free writing mode”,”strong”:”Bold”,”strongClose”:”Close bold tag”,”em”:”Italic”,”emClose”:”Close italic tag”,”link”:”Insert link”,”blockquote”:”Blockquote”,”blockquoteClose”:”Close blockquote tag”,”del”:”Deleted text (strikethrough)”,”delClose”:”Close deleted text tag”,”ins”:”Inserted text”,”insClose”:”Close inserted text tag”,”image”:”Insert image”,”ul”:”Bulleted list”,”ulClose”:”Close bulleted list tag”,”ol”:”Numbered list”,”olClose”:”Close numbered list tag”,”li”:”List item”,”liClose”:”Close list item tag”,”code”:”Code”,”codeClose”:”Close code tag”,”more”:”Insert Read More tag”};/* ]]> */ /* <![CDATA[ */ var avia_shortcode_preview = ‘d1c0f741b7’; /* ]]> */ <!– Debugging Info for Theme support: Theme: Enfold Test Version: 3.6.1 Installed: enfold-test AviaFramework Version: 4.5.3 AviaBuilder Version: 0.8 – – – – – – – – – – – ChildTheme: Enfold-Test Child ChildTheme Version: 3.6.1 ChildTheme Installed: enfold-test ML:256-PU:64-PLA:14 WP:4.6.1 Updates: disabled –> function aioseop_show_pointer(handle, value) { if (typeof( jQuery ) != ‘undefined’) { var p_edge = ‘bottom’; var p_align = ‘center’; if (typeof( jQuery(value.pointer_target).pointer) != ‘undefined’) { if (typeof( value.pointer_edge ) != ‘undefined’) p_edge = value.pointer_edge; if (typeof( value.pointer_align ) != ‘undefined’) p_align = value.pointer_align; jQuery(value.pointer_target).pointer({ content: value.pointer_text, position: { edge: p_edge, align: p_align }, close: function () { jQuery.post(ajaxurl, { pointer: handle, action: ‘dismiss-wp-pointer’ }); } }).pointer(‘open’); } } } /* <![CDATA[ */ var wpNotesIsJetpackClient = true; var wpNotesIsJetpackClientV2 = true; /* ]]> */ if ( window.history.replaceState ) { window.history.replaceState( null, null, document.getElementById( ‘wp-admin-canonical’ ).href + window.location.hash ); } var _wpColorScheme = {“icons”:{“base”:”#82878c”,”focus”:”#00a0d2″,”current”:”#fff”}}; .aioseop_edit_button { margin: 0 0 0 5px; opacity: 0.6; width: 12px; } .aioseop_edit_link { display: inline-block; position: absolute; } .aioseop_mpc_SEO_admin_options_edit img { margin: 3px 2px; opacity: 0.7; } .aioseop_mpc_admin_meta_options { float: left; display: block; opacity: 1; max-height: 75px; overflow: hidden; width: 100%; } .aioseop_mpc_admin_meta_options.editing { max-height: initial; overflow: visible; } .aioseop_mpc_admin_meta_content { float: left; width: 100%; margin: 0 0 10px 0; } td.seotitle.column-seotitle, td.seodesc.column-seodesc, td.seokeywords.column-seokeywords { overflow: visible; } @media screen and (max-width: 782px) { body.wp-admin th.column-seotitle, th.column-seodesc, th.column-seokeywords, td.seotitle.column-seotitle, td.seodesc.column-seodesc, td.seokeywords.column-seokeywords { display: none; } } //<![CDATA[ var aioseopadmin = { blogUrl: “http://rosewoodva.ca”, pluginUrl: “http://rosewoodva.ca/wp-content/plugins/all-in-one-seo-pack/”, requestUrl: “http://rosewoodva.ca/wp-admin/admin-ajax.php”, imgUrl: “http://rosewoodva.ca/wp-content/plugins/all-in-one-seo-pack/images/”, Edit: “Edit”, Post: “Post”, Save: “Save”, Cancel: “Cancel”, postType: “post”, pleaseWait: “Please wait…”, slugEmpty: “Slug may not be empty!”, Revisions: “Revisions”, Time: “Insert time” } //]]> #wpadminbar { display:none; } document.body.className = document.body.className.replace(‘no-js’,’js’); (function() { var request, b = document.body, c = ‘className’, cs = ‘customize-support’, rcs = new RegExp(‘(^|\\s+)(no-)?’+cs+'(\\s+|$)’); request = true; b[c] = b[c].replace( rcs, ‘ ‘ ); b[c] += ( window.postMessage && request ? ‘ ‘ : ‘ no-‘ ) + cs; }()); Skip to main content Skip to toolbar Dashboard DashboardHomeUpdates 3 All in One SEO All in One SEOGeneral SettingsPerformanceFeature Manager Jetpack JetpackDashboardSettingsSite StatsAkismet LiveSite LiveSiteLiveSiteSettingsBackofficeContact FormLiveSite Widget Posts PostsAll PostsAdd NewCategoriesTags Media MediaLibraryAdd NewWP Smush Pages PagesAll PagesAdd New Comments 0 Portfolio Items Portfolio ItemsPortfolio ItemsAdd NewTagsPortfolio Categories Enfold-Test Child Contact ContactContact FormsAdd NewIntegration Appearance AppearanceThemesCustomizeWidgetsMenusEdit CSSEditor Plugins 0 Plugins 0Installed PluginsAdd NewEditor Users UsersAll UsersAdd NewYour Profile Tools ToolsAvailable ToolsImportExportSEO Data ImportBackupsBackup Settings SettingsGeneralWritingReadingDiscussionMediaPermalinksWP Content Copy Protection (YOOPlugins)Easy TableSharingXML-Sitemap Shortcodes ShortcodesSettingsExamplesCheatsheetAdd-ons Google Analytics Google AnalyticsGoogle AnalyticsOther Plugins LayerSlider WP LayerSlider WPAll SlidersSkin EditorCSS EditorTransition BuilderCollapse menu Menu About WordPress About WordPress WordPress.org Documentation Support Forums Feedback Rosewood Virtual Admin Visit Site 33 Theme Updates 00 comments awaiting moderation New Post Media Page Portfolio Entry User LayerSlider Theme Options General Layout General Styling Advanced Styling Header Sidebar Settings Footer Blog Layout Social Profiles Newsletter Demo Import Import/Export Theme Update SEO Upgrade To Pro Performance Feature Manager #adminbar-search::-webkit-input-placeholder, #adminbar-search:-moz-placeholder, #adminbar-search::-moz-placeholder, #adminbar-search:-ms-input-placeholder { text-shadow: none; } Howdy, deannasimone deannasimone Edit My Profile Log Out Notifications Log Out Logged in as: (Email address hidden if logged out) | Rate us: <!– –><!– –><!– –><!– –> Lead Capturing Contact Form Part of vCita LiveSite Pack Lead Capturing Contact Form is part of vCita LiveSite Pack Your LiveSite Modules: Contact Form Create beautiful forms using a simple Drag & Drop editor. Edit Livesite Widget Encourage clients to take actions and capture twice as many leads Edit Payments Button Offer your clients a simple way to pay for your services Add Scheduler Self service appointment scheduling for your clients Add One Platform which enables all modules Backoffice All livesite modules plug into a single business management dashboard Go to Backoffice <!– –> SDK for Developers To achieve maximum flexibility use our LiveSite SDK Go to SDK Documentation <!– –> Partner Program Join over 8500 partners who leverage the vCita web engagement solution to extend their brand Learn More Account Settings Disconnect Rate US Support <!– wpbody-content –> <!– wpbody –> <!– wpcontent –> Thank you for creating with WordPress. Version 4.6.1 Close dialog Session expired Please log in again. The login page will open in a new window. After logging in you can close it and return to this page. /* <![CDATA[ */ var jpTracksAJAX = {“ajaxurl”:”http:\/\/rosewoodva.ca\/wp-admin\/admin-ajax.php”,”jpTracksAJAX_nonce”:”dfff5d7dd8″}; /* ]]> */ /* <![CDATA[ */ var commonL10n = {“warnDelete”:”You are about to permanently delete these items.\n ‘Cancel’ to stop, ‘OK’ to delete.”,”dismiss”:”Dismiss this notice.”};var heartbeatSettings = {“nonce”:”9006d09a94″};var authcheckL10n = {“beforeunload”:”Your session has expired. You can log in again from this page or go to the login page.”,”interval”:”180″};var wpAjax = {“noPerm”:”Sorry, you are not allowed to do that.”,”broken”:”An unidentified error has occurred.”};var wpPointerL10n = {“dismiss”:”Dismiss”};/* ]]> */ <!– wpwrap –> if(typeof wpOnload==’function’)wpOnload();
Topic: Search results in columns
Hi i find the solution to display the search results in columns with this code:
’ve seen a topic where is asking this. This is the answer:1) Insert following code into the quick css field:
.template-search .post-entry {
clear: none !important;
}2) In search.php replace:
if(!empty($_GET[‘s’]))
{
echo “<h4 class=’extra-mini-title widgettitle’>{$results}</h4>”;/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-search.php and that will be used instead.
*/
$more = 0;
get_template_part( ‘includes/loop’, ‘search’ );}
with:
if(!empty($_GET[‘s’]))
{
echo “<h4 class=’extra-mini-title widgettitle’>{$results}</h4>”;global $posts;
$post_ids = array();
foreach($posts as $post) $post_ids[] = $post->ID;$atts = array(
‘type’ => ‘grid’,
‘items’ => get_option(‘posts_per_page’),
‘columns’ => 2,
‘class’ => ‘avia-builder-el-no-sibling’,
‘paginate’ => ‘yes’,
‘use_main_query_pagination’ => ‘yes’,
‘custom_query’ => array( ‘post__in’=>$post_ids, ‘post_type’=>get_post_types() )
);$blog = new avia_post_slider($atts);
$blog->query_entries();
echo “<div class=’entry-content’>”.$blog->html().”</div>”;
}But how can i remove the meta data: categories, comments and date? The only thing that has to be displaid here, are the title with permalink and the featured image.


