How Can I Display the Last Modified Date for User Profiles on WordPress?
How Can I Display the Last Modified Date for User Profiles on WordPress?
How Can I Display the Last Modified Date for User Profiles on WordPress?
How to Call Related Post based on Categories Inside Post Content with Shortcode?
Add a url parameter to the current post and read it in a shortcode
Including content into an add_shortcode() function
I’m not too familiar with BuddyPress and a total stranger to rtmedia. But out of curiosity I had a brief look at their documentations. Perhaps you could add a custom shortcode to your functions.php, which gets the current profile ID and uses it with the rtmedia gallery shortcode to display videos from the profile. Something … Read more
function show_the_views_func( $atts ){ $atts = shortcode_atts( array( ‘placeholder’ => ”, ), $atts ); $count = get_post_meta( get_the_ID(), ‘views’, true ); return $count . $atts[‘placeholder’] . ‘ views’; } add_shortcode( ‘show-the-views’, ‘show_the_views_func’ ); echo do_shortcode( ‘[show-the-views placeholder=”test”]’ );
The only way I could figure out how to get do_shortcode working was by using WP_Query. <?php // get current site $args = [ ‘p’ => $post_id, ‘post_type’ => ‘any’ ]; // site wp query $oSite = new WP_Query($args); ?> <?php if ( $oSite->have_posts() ): ?> <?php while($oSite->have_posts()): $oSite->the_post() ?> <div id=”gform_ajax_wrapper_<?=$form_id?>”> <?=do_shortcode(‘[gravityform id=”‘.$form_id.'” title=”false” … Read more
How can I create a shortcode from an html and php code written together
I am guessing your are talking about customizing the look of the output from the shortcode to match the design of the page better is that correct? If so then I would style it using Firebug and CSS.
Oh, I didn’t thought it would be that easy. So when I am storing the html in a variable “$htmlContent” and echo the variable in my template I can just wrap the variable in the do_shortcode() function echo do_shortcode($htmlContent); Maybe this answer are useful for other with the same problem.