Different ‘WP_CONTENT_URL’ for different subsites in Multisite setup?

Is it possible to set different WP_CONTENT_URL values for different sub-sites in wp-config.php ? Ans: Yes it is. If sub sites are installed on sub-domain, An example to define it this way – define( ‘CURRENT_SITE_DOMAIN’, $_SERVER[‘HTTP_HOST’] ); if( ‘sub1.domain.com’ == CURRENT_SITE_DOMAIN ){ define( ‘WP_CONTENT_URL’, ‘http://sub1-abcdefghijk.cloudfront.net/wp-content’ ); } elseif( ‘sub2.domain.com’ == CURRENT_SITE_DOMAIN ){ define( ‘WP_CONTENT_URL’, ‘http://sub2-abcdefghijk.cloudfront.net/wp-content’ … Read more

Check if has any sidebar active on current page

I believe the issue here is a problem with vernacular. is_active_sidebar isn’t page specific — just checks to see if it has data within it throughout the entire site. You are asking a different question. Sounds like you are asking “does this template reference and sidebars AND do any of those sidebars have data in … Read more

remove the wrapping of text widget or

More than likely this is an issue with the register_sidebar() call in functions.php. Look for before_widget and after_widget. The code below is the default usage. ‘before_widget’ => ‘<li id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</li>’, Note: This will alter all of the widgets within the sidebar, not just the TextWidget.

Get Category and Excerpt From wp_get_recent_posts

I would suggest using WP_Query() instead. Like so: <?php $category = ‘whatever’; $new_query = new WP_Query( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1, ‘category_name’ => $category; ) ); if ($new_query->have_posts()) { $i = 0; while ($new_query->have_posts()) { $new_query->the_post(); $postid = get_the_ID(); // Your output code. } } wp_reset_postdata(); ?> Merely change $category to whatever you … Read more

Shortcode with parameters inside parameters

The days of the week shortcodes aren’t needed. Also, the way you’re trying to use them isn’t allowed. Why not just use the title and do what you want in the books shortcode? function books($atts, $content = null) { $atts = shortcode_atts( [ “name” => ”, “day” => ”, “title” => ”, ], $atts ); … Read more

Can shortcodes contain conditional statements? Even without them my shortcode renders blank page

your conditional breaks the concatenation of the strings (which is not in your code, anyway) try to re-write this section: function info($atts, $content = null) { extract(shortcode_atts(array( “name” => ”, “image” => ”, “address” => ”, “phone” => ”, “email” => ”, “website” => ”, “description” => ”, “amenities” => ” ), $atts)); $output=”<span class=”sort”>”; … Read more