Php echo into tag

If you want to wrap an HTML tag around the user display names, you can simply close and open the PHP tags: <div class=”author_sidebar”> <?php if ( is_singular( ‘post’ ) ) { ?> <div class=”foo”><?php echo get_avatar( get_the_author_meta( ‘user_email’ ), 75 ); ?></div> <div class=”bar”><?php echo get_the_author_meta( ‘display_name’ ); ?> <?php } ?> </div>

Make a permalink to the most recent blog post

Use get_posts with posts_per_page => 1 to get only one latest result. You can than use get_permalink() to get the permalink. $args = array( ‘posts_per_page’ => 1, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ) ; $latest_posts = get_posts($args); $permalink = get_permalink($latest_posts[0]->ID);

Search result page – display values from the result’s metaboxes

You just need to get the data using get_post_meta(). <h1><a href=”https://wordpress.stackexchange.com/questions/185685/<?php echo get_permalink()?>”><?php the_title(); ?></a></h1> <span class=”description”> <?php echo get_post_meta( get_the_ID(), ‘mobile_adv_service_desc’, true ); ?> </span> This Plugin stores your values as WordPress metadata. So to retrieve the values in the frontend, you can use the built in WordPress functions for that.

Is this WordPress code causing page weirdness? Can’t scroll to bottom

It was Stellar parallax. Here is the offending code: // Stellar parallax var $ = jQuery.noConflict(); $(function(){ $.stellar({ horizontalScrolling: false, verticalOffset: 40 }); }); I now need to go away and figure out what in this code was giving me the problem. Thanks for the prompts of where to look.

How do I return an image from a script

Fatal error: Call to undefined function __() in /homepages/5/d367772185/htdocs/rodandfly/wp-admin/includes/file.php on line 13 Where is your code? file.php is expecting __() to be defined which it should be if your loading it from within an activated plugin. The best way to do what your trying to do is use either media_handle_sidelaod() or media_sideload_image() which will cause … Read more

How to use plugins_url() inside PHP stylesheet file [duplicate]

Try background:url(<?php echo plugins_url().’/myimgfolder/my_img.png’; ?>) no-repeat <?php echo $x_position.’ ‘.$y_position; ?>; It will allow you to echo the PHP elements into your style. EDIT: You also need to close the file, you’re trying to mix unwrapped PHP with your CSS. Your PHP variables aren’t escaped either. I’ve tested the code below, and it works fine: … Read more