Remove Permalink From Admin Edit Post

I’m running the most up to date version of WordPress which has made changes to how permalinks are displayed and handled. There’s no longer a View Post button. I was able to remove the whole area using the get_sample_permalink_html hook. Just return an empty string: function hide_permalink() { return ”; } add_filter( ‘get_sample_permalink_html’, ‘hide_permalink’ );

set title attribute in wp_get_attachment_image()

In a relatively fresh install I can’t replicate the issue. When I post your code with my own image ID I get the title=”My Custom Title” attribute. It’s important to note however that the “Title” of an image in the media library is not output as a title attribute in the standard output of wp_get_attachment_image(). … Read more

How to echo all the_title() without text after last “-“

This is really a PHP question not so much a WP question — but: echo substr($stringx,0,strrpos($stringx,’-‘)); Also I think your example #3 is wrong unless there are some cases where you want to exclude more than simply after the final dash character. Note – if you want to exclude both that final blank space along … Read more

Wrap the_title_attribute in a H2 within a Conditional Tag?

The the_title_attribute() template tag is intended specifically for outputting the Title formatted for use in an anchor tag title attribute. The the_title() and get_the_title() template tags are intended for general print/display of the Title. I would recommend using get_the_title(), rather than the_title_attribute(). To wit: elseif( get_post_type($post->ID) == ‘press’ ){echo'<h2>’. get_the_title() .'</h2>’;} I believe this would … Read more

What is full URL for a post?

There is nothing after the slash. Do not see the address as something like a directory structure. It is just an address, a unique string to tell WordPress which content it should load. That content will be loaded into any template, and that template again could be composed of multiple separate files from the theme.

previous_posts_link and next_posts_link, how to return the next/previous post’s title as the url

The functions you are using refer to the next or prev paginated set of posts, not a single post, hence the format they are in. Try using get_adjacent_post() instead. <?php $prev = get_adjacent_post(false, ”, true) $next = get_adjacent_post(false, ”, false) //use an if to check if anything was returned and if it has, display a … Read more