Filter for get_singular_dynamic_css
-
I am using custom post types to add content to the headers and footers of my site. Unfortunately, your blocks don’t work in this scenario. A filter along this line would be helpful.
public function get_singular_dynamic_css($post = false) { $getCSS = ''; $posts = array(); if ($post) { //$getCSS = $this->single_stylesheet( $post ); $posts[] = $post; } elseif (is_singular()) { global $post; $posts[] = $post; //$getCSS = $this->single_stylesheet( $post ); } elseif (is_archive() || is_home() || is_search()) { global $wp_query; if (isset($wp_query->posts)) { /*foreach ( $wp_query->posts as $post ) { $getCSS .= $this->single_stylesheet( $post ); }*/ $posts = $wp_query->posts; } } $posts = apply_filters('get_singular_dynamic_css_filter', $posts); foreach ($posts as $post) { $getCSS .= $this->single_stylesheet($post); } $output = gutentor_dynamic_css()->minify_css($getCSS); return $output; }does this make sense? does it seem reasonable?
thanks for a great system.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Filter for get_singular_dynamic_css’ is closed to new replies.