Astra_Ext_Blog_Pro_Markup::add_styles()

Add style.


Description


Return

(void.)


Source

File: addons/blog-pro/classes/class-astra-ext-blog-pro-markup.php

		public function add_styles() {

			$author_info          = astra_get_option( 'ast-author-info' );
			$enable_related_posts = astra_get_option( 'enable-related-posts' );

			/*** Start Path Logic */

			/* Define Variables */
			$uri  = ASTRA_EXT_BLOG_PRO_URI . 'assets/css/';
			$path = ASTRA_EXT_BLOG_PRO_DIR . 'assets/css/';
			$rtl  = '';

			if ( is_rtl() ) {
				$rtl = '-rtl';
			}

			/* Directory and Extension */
			$file_prefix = $rtl . '.min';
			$dir_name    = 'minified';

			if ( SCRIPT_DEBUG ) {
				$file_prefix = $rtl;
				$dir_name    = 'unminified';
			}

			$css_uri = $uri . $dir_name . '/';
			$css_dir = $path . $dir_name . '/';

			if ( defined( 'ASTRA_THEME_HTTP2' ) && ASTRA_THEME_HTTP2 ) {
				$gen_path = $css_uri;
			} else {
				$gen_path = $css_dir;
			}

			/*** End Path Logic */

			/* Add style.css */
			Astra_Minify::add_css( $gen_path . 'style' . $file_prefix . '.css' );

			if ( $author_info ) {
				Astra_Minify::add_css( $gen_path . 'post-author' . $file_prefix . '.css' );
			}

			if ( $enable_related_posts ) {
				Astra_Minify::add_css( $gen_path . 'related-posts' . $file_prefix . '.css' );
			}

			/* Blog Layouts */
			$blog_layout = astra_get_option( 'blog-layout' );
			if ( true === Astra_Addon_Builder_Helper::apply_flex_based_css() && ( 'blog-layout-2' == $blog_layout || 'blog-layout-3' == $blog_layout ) ) {
				$blog_layout = $blog_layout . '-flex';
			}
			Astra_Minify::add_css( $gen_path . $blog_layout . $file_prefix . '.css' );
		}

Changelog

Changelog
Version Description
1.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.