What’s the proper way to use the get_image_tag filter?

I’m attempting to remove the title attribute for post thumbnails (on certain posts), and I assume the get_image_tag filter is the way to do this. However, what I’ve got so far isn’t working. What do I need to change to make this work? My code: add_filter(‘get_image_tag’, ‘image_no_title’); function image_no_title($title) { $title=””; return $title; } And … Read more

Get title of page from URL

I have a “Go back button”: $url = htmlspecialchars( $_SERVER[‘HTTP_REFERER’] ); echo “<a href=”https://wordpress.stackexchange.com/questions/211840/$url”>back</a>”; I need to display the page title of the $url, something like this: $url = htmlspecialchars( $_SERVER[‘HTTP_REFERER’] ); echo “<a href=”https://wordpress.stackexchange.com/questions/211840/$url”>Go back to the INSERT PAGE TITLE HERE</a>”; Does anyone know how to do this? 1 Answer 1 WordPress has a … Read more

wp_title() empty on a static front page

I’m trying to use wp_title() to create a heading for my pages, but I’m using a static front page and, while all of the other pages render the title properly, the front page won’t. This is what I’m working with: <div id=”main-content”> <h1><?php wp_title(“”, true); ?></h1> <?php while( have_posts() ) : the_post() ?> <div class=”pagecontent”> … Read more

How Can i Get 5 Recent Post Title With Corresponding Link?

I Want to Add My Latest 5 Post Title with Corresponding Link in My Header Position.What was the Actual Php code?Am Newbie …. 2 Answers 2 This sounds like an additional Loop on that page, right? You might want to use: <ul> <?php $posts_query = new WP_Query(‘posts_per_page=5’); while ($posts_query->have_posts()) : $posts_query->the_post(); ?> <li><a href=”https://wordpress.stackexchange.com/questions/20489/<?php the_permalink(); … Read more

Add a Span Around a Product Title in WooCommerce [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 7 … Read more