WordPress widget title coding

The problem is pretty simple: Some widgets do have a title, while others don’t. As long as the title filter is present, it works. Example of what the plugin might have: echo apply_filters( ‘widget_title’, $instance[‘title’] ); If that filter is not present, there won’t be a title.

convert post title to image

In General The problem here is that you’re calling a WordPress function within a PHP file where WordPress isn’t loaded. Including WordPress in your image.php file might work if you include the post ID <img src=”https://wordpress.stackexchange.com/wp-content/themes/v2/image.php?post_id=123″ /> But imagine if you have 100 images on a single page, then you would be running 101 instances … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)