Variables not showing in short code

Try this: function banner_shortcode() { $banner = esc_url( get_stylesheet_directory_uri() . ‘/images/banner.jpg’ ); $banner__feature = esc_url( get_stylesheet_directory_uri() . ‘/images/banner__feature–easter.jpg’ ); return ‘<div class=”banner banner–call-now” data-parallax=”scroll” data-bleed=”100″ data-image-src=”‘ . $banner . ‘”> <div class=”banner__left”> <img class=”img-responsive” src=”‘ . $banner__feature . ‘”> </div> <div class=”banner__center”> <h2 class=”banner__title”>Call Now!</h2> <h1 class=”banner__phone”><strong><a href=”tel:1-570-877-8595″><strong>570-877-8595</strong></a></strong></h1> </div> <div class=”banner__right”> <img class=”img-responsive” src=”‘ . … Read more

How to parse a shortcode within a shortcode?

The function you are looking for is named do_shortcode (there will also be a function apply_shortcode in WordPress 5.4 that does the same). Codex Page For your example, this will work: function content_for_logged_in($atts,$content){ $logged_in_content = “”; if(is_user_logged_in()){ $logged_in_content = do_shortcode($content); } return $logged_in_content; } add_shortcode(‘logged-in-content’,’content_for_logged_in’); Happy Coding!

Remove the month and year from a WordPress Date?

You’ll need to write your OWN function that will take the post_date and return it reformatted to the style you’re looking for. function my_date($input_date) { return date(“S”, strtotime($input_date)); } And then you would call it within your Pods Template like {@post_date, my_date} All rights goes to Jim True. More infomations : https://pods.io/forums/topic/date-formatting-using-magic-tags/

Change menu based on page template via functions.php

The $args the filter is receiving includes the theme_location used when the menu was registered, so assuming your main location is primary, you can add the following to your if statement to target only that menu: if ( is_page_template( ‘page-template-custom.php’ ) && isset( $args[‘theme_location’] ) && ‘primary’ === $args[‘theme_location’] ) ) { … See: https://developer.wordpress.org/reference/hooks/wp_nav_menu_args/ … Read more

does wp function the_content(); accept another tag inside

Why do you want to put your code between the braces in the_content()? What are you trying to accomplish? Maybe this solves your problem? <?php $custom_attach = get_post_meta( get_the_ID(), ‘wp_custom_attachment’, true ); $name=”button”; if(!empty($custom_attach)) { echo ‘<span class=”icon-download”>’; echo ‘<a href=”‘.$custom_attach[‘url’].'”>’.$name.'</a>’; echo ‘<span>’; } the_content(); ?> This echoes the <span> -element with the class icon-download … Read more