public function inline_styles() { wp_enqueue_style('custom-style', WPIDB_URL . 'custom_script.css'); $custom_css = ""; $args = array('post_type' => 'wpi_des_but_sty', 'post_status' => array('publish'), 'numberposts' => -1); $button_styles = get_posts($args); foreach ($button_styles as $s) { $element = ".wpi_designer_button_" . $s->ID; //border $border_left = "0px!important"; $border_right = "0px!important"; $border_bottom = "0px!important"; $border_top = "0px!important"; switch ($s->border_sides) { case "all": $border_left = ""; $border_right = ""; $border_bottom = ""; $border_top = ""; break; case "top": $border_top = ""; break; case "bottom": $border_bottom = ""; break; case "left": $border_left = ""; break; case "right": $border_right = ""; break; } //padding $padding = "0px"; if ($s->padding) { $padding = str_replace("px", "", $s->padding); $padding = $padding . "px " . $padding * 2 . "px"; } if ($s->texture == "" || $s->texture == "no") { $texture = "none"; } else { $texture = "url(" . WPIDB_URL . "images/" . $s->texture . ")"; } $classes = array(array("element" => $element, "styles" => array("font-family" => $s->font . "!important", "font-size" => $s->text_size . "!important", "font-weight" => $s->font_weight . "!important", "border-width" => $s->border_width . "!important", "border-left-width" => $border_left, "border-right-width" => $border_right, "border-top-width" => $border_top, "border-bottom-width" => $border_bottom, "border-style" => $s->border_style . "!important", "padding" => $padding . "!important", "display" => $s->display . "!important", "color" => $s->text_color . "!important", "background-color" => $s->background_color . "!important", "border-color" => $s->border_color . "!important", "background-image" => $texture . "!important")), array("element" => $element . ":hover", "styles" => array("color" => $s->text_color_h . "!important", "background-color" => $s->background_color_h . "!important", "border-color" => $s->border_color_h . "!important")), array("element" => $element . ":active", "styles" => array("color" => $s->text_color_a . "!important", "background-color" => $s->background_color_a . "!important", "border-color" => $s->border_color_a . "!important")), array("element" => $element . ".wpi_no_text", "styles" => array("padding" => $s->padding . "!important"))); $custom_css .= WPiCss::build_css($classes); } wp_add_inline_style('custom-style', $custom_css); }
public function get_styles() { $custom_css = ""; $args = array('post_type' => 'wpi_des_but_sty', 'post_status' => array('publish'), 'numberposts' => -1); $button_styles = get_posts($args); foreach ($button_styles as $s) { $element = ".wpi_designer_button_" . $s->ID; //border $border_left = "0px!important"; $border_right = "0px!important"; $border_bottom = "0px!important"; $border_top = "0px!important"; switch ($s->border_sides) { case "all": $border_left = ""; $border_right = ""; $border_bottom = ""; $border_top = ""; break; case "top": $border_top = ""; break; case "bottom": $border_bottom = ""; break; case "left": $border_left = ""; break; case "right": $border_right = ""; break; } //padding $padding = "0px"; if ($s->padding) { $padding = str_replace("px", "", $s->padding); $padding = $padding . "px " . $padding * 2 . "px"; } if ($s->texture == "" || $s->texture == "no") { $texture = "none"; } else { $texture = "url(" . WPIDB_URL . "images/" . $s->texture . ")"; } if ($s->shadow == "" || $s->shadow == "no") { $shadow = "0px"; } else { $shadow = $s->shadow; } if ($s->shadow_type != "") { $shadow_type = $s->shadow_type; } else { $shadow_type = ""; } if ($s->glow_size == "" || $s->glow_size == "no") { $glow = "0px"; } else { $glow = $s->glow_size; } if ($s->text_shadow == "" || $s->text_shadow == "no") { $text_shadow = "0px"; } else { $text_shadow = $s->text_shadow; } if ($s->shape == "" || $s->shape == "rectangle") { $radius = "0px"; } else { $radius = $s->shape; } if ($s->background_color == "") { $s->background_color = "transparent"; } if ($s->background_color_h == "") { $s->background_color_h = "transparent"; } if ($s->background_color_a == "") { $s->background_color_a = "transparent"; } $classes = array(array("element" => $element, "styles" => array("font-family" => $s->font . "!important", "font-size" => $s->text_size . "!important", "font-weight" => $s->font_weight . "!important", "border-width" => $s->border_width . "!important", "border-left-width" => $border_left, "border-right-width" => $border_right, "border-top-width" => $border_top, "border-bottom-width" => $border_bottom, "border-style" => $s->border_style . "!important", "padding" => $padding . "!important", "display" => $s->display . "!important", "min-width" => $s->min_width . "!important", "color" => $s->text_color . "!important", "background-color" => $s->background_color . "!important", "border-color" => $s->border_color . "!important", "background-image" => $texture . "!important", "box-shadow-x" => $shadow, "box-shadow-y" => $shadow, "box-shadow-blur" => $shadow, "box-shadow-inset" => $shadow_type, "text-shadow-x" => $text_shadow, "text-shadow-y" => $text_shadow, "text-shadow-blur" => $text_shadow, "box-shadow-x" => "0px", "box-shadow-y" => "0px", "box-shadow-blur" => $glow, "border-radius" => $radius . "!important")), array("element" => $element . ":hover", "styles" => array("color" => $s->text_color_h . "!important", "background-color" => $s->background_color_h . "!important", "border-color" => $s->border_color_h . "!important")), array("element" => $element . ":active", "styles" => array("color" => $s->text_color_a . "!important", "background-color" => $s->background_color_a . "!important", "border-color" => $s->border_color_a . "!important")), array("element" => $element . ".wpi_no_text", "styles" => array("padding" => $s->padding . "!important"))); $custom_css .= WPiCss::build_css($classes); } return $custom_css; }
public function get_twin() { $custom_css = ""; $args = array('post_type' => 'wpi_des_but_tb', 'post_status' => array('publish'), 'numberposts' => -1); $twin_button_styles = get_posts($args); foreach ($twin_button_styles as $s) { $element = ".wpi_twin_button_" . $s->ID . " .wpi_designer_button"; if ($s->shadow == "" || $s->shadow == "no") { $shadow = "0px"; } else { $shadow = $s->shadow; } $classes = array(array("element" => $element, "styles" => array("min-width" => $s->min_width . "!important"))); $custom_css .= WPiCss::build_css($classes); } return $custom_css; }
public function inline_styles() { wp_enqueue_style('custom-style', WPIDB_URL . 'custom_script.css'); $custom_css = ""; $args = array('post_type' => 'wpi_des_but_sb', 'post_status' => array('publish'), 'numberposts' => -1); $slide_styles = get_posts($args); foreach ($slide_styles as $ss) { /*if( $ss->background_custom_image!="") { $background_image= "url(". $ss->background_custom_image.")" ; }else{ $background_image=$ss->background_image=="no" ? "none" : "url(". WPIDB_URL ."images/".$ss->background_image.")" ; } */ $classes = array(array("element" => ".wpi_share_buttons_" . $ss->ID, "styles" => array("padding-top" => $ss->frame_padding_top, "padding-bottom" => $ss->frame_padding_bottom, "padding-left" => $ss->frame_padding_left, "padding-right" => $ss->frame_padding_right)), array("element" => ".wpi_share_buttons_" . $ss->ID . " li", "styles" => array("margin-right" => $ss->button_gap, "margin-bottom" => $ss->button_gap))); $custom_css .= WPiCss::build_css($classes); } wp_add_inline_style('custom-style', $custom_css); }
public function inline_styles() { wp_enqueue_style('custom-style', WPIDB_URL . 'custom_script.css'); $custom_css = ""; $args = array('post_type' => 'wpi_des_but_sli', 'post_status' => array('publish'), 'numberposts' => -1); $slide_styles = get_posts($args); foreach ($slide_styles as $ss) { if ($ss->background_custom_image != "") { $background_image = "url(" . $ss->background_custom_image . ")"; } else { $background_image = $ss->background_image == "no" ? "none" : "url(" . WPIDB_URL . "images/" . $ss->background_image . ")"; } if ($ss->background_repeat_image == "" || $ss->background_repeat_image == "no") { $ss->background_repeat_image = "none"; } else { $ss->background_repeat_image = "url(" . WPIDB_URL . "images/" . $ss->background_repeat_image . ")"; } $slide_footer_display = $ss->slide_footer_text == "" ? "none" : " "; if ($ss->frame_margin_left == "0px") { $ss->frame_margin_left = "auto"; } if ($ss->frame_margin_right == "0px") { $ss->frame_margin_right = "auto"; } $classes = array(array("element" => ".wpi_slide_" . $ss->ID, "styles" => array("min-height" => $ss->frame_height, "width" => $ss->frame_width, "background-color" => $ss->background_color, "background-image" => $ss->background_repeat_image, "color" => "#ffffff", "margin-left" => $ss->frame_margin_left, "margin-right" => $ss->frame_margin_right)), array("element" => ".wpi_slide_" . $ss->ID . " .wpi_slide_heading", "styles" => array("font-size" => $ss->slide_heading_size, "font-weight" => $ss->slide_heading_font_weight, "font-family" => $ss->slide_heading_font, "color" => $ss->slide_heading_color, "background-color" => $ss->slide_heading_background_color, "margin-top" => $ss->slide_heading_margin_top, "margin-left" => $ss->slide_heading_margin_left, "margin-right" => $ss->slide_heading_margin_right, "margin-bottom" => $ss->slide_heading_margin_bottom, "padding" => $ss->slide_heading_padding, "border-width" => $ss->slide_heading_border_width, "border-color" => $ss->slide_heading_border_color, "line-height" => $ss->slide_heading_line_height, "letter-spacing" => $ss->slide_heading_letter_spacing, "text-shadow-x" => $ss->slide_heading_shadow_distance, "text-shadow-y" => $ss->slide_heading_shadow_distance, "text-shadow-blur" => $ss->slide_heading_shadow_distance)), array("element" => ".wpi_slide_" . $ss->ID . " .wpi_slide_text", "styles" => array("font-size" => $ss->slide_text_size, "font-weight" => $ss->slide_text_font_weight, "font-family" => $ss->slide_text_font, "color" => $ss->slide_text_color, "margin-top" => $ss->slide_text_margin_top, "margin-left" => $ss->slide_text_margin_left, "margin-right" => $ss->slide_text_margin_right)), array("element" => ".wpi_slide_" . $ss->ID . " .wpi_slide_image", "styles" => array("left" => "0px", "top" => "0px", "background-image" => $background_image, "blur" => $ss->background_image_blur, "opacity" => $ss->background_image_opacity / 100)), array("element" => ".wpi_slide_" . $ss->ID . " .wpi_designer_button", "styles" => array("margin-top" => $ss->button_margin_top, "margin-bottom" => $ss->button_margin_bottom)), array("element" => ".wpi_slide_" . $ss->ID . " .wpi_slide_footer", "styles" => array("padding" => $ss->slide_footer_padding, "display" => $slide_footer_display, "font-size" => $ss->slide_footer_text_size))); $custom_css .= WPiCss::build_css($classes); } wp_add_inline_style('custom-style', $custom_css); }
public function get_smart() { $custom_css = ""; $args = array('post_type' => 'wpi_des_but_smb', 'post_status' => array('publish'), 'numberposts' => -1); $smart_button_styles = get_posts($args); foreach ($smart_button_styles as $s) { $element = ".wpi_smart_button_" . $s->ID; $classes = array(array("element" => $element, "styles" => array("text-align" => $s->button_align))); $custom_css .= WPiCss::build_css($classes); } return $custom_css; }