WordPress developer

Even though technically WordPress is a Content Management System (CMS), I think of it as a framework. It provides templating, caching, routing, database abstraction, etc. If you want to be a WordPress developer you need to know PHP, obviously, but you also need know how WordPress uses PHP and get familiar with the “WordPress Way” … Read more

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.