Filter Widget Title Wrap

The filter to do this is dynamic_sidebar_params also see this tutorial on this filter at ACF’s site (even if you don’t use ACF). function prefix_filter_widget_title_tag( $params ) { $params[0][‘before_title’] = ‘<h2 class=”widget-title widgettitle”>’ ; $params[0][‘after_title’] = ‘</h2>’ ; return $params; } add_filter( ‘dynamic_sidebar_params’ , ‘prefix_filter_widget_title_tag’ );

Verify if tag is used on posts

Try using the has_tag() conditional template tag. e.g., to query for the tag “foobar”: <?php if ( has_tag( ‘foobar’ ) ) { // The current post has the tag “foobar”; // do something } else { // The current post DOES NOT have the tag “foobar”; // do something else } ?> If you’re inside … Read more

Get title of post without using the_title();

This is because the_title() echos the post title (see the linked documentation). Use get_the_title() instead which returns the title as a string. Edit You have two options: Use get_the_title() to return, rather than echo, the post title Filter the_title to echo a custom string as the post title Using get_the_title() <?php // NOTE: Inside the … Read more

title_save_pre on post publish

The filter title_save_pre runs before the post is written to the database, and also before any of its post meta is saved to the database. So get_post_meta at this point will be blank for the first run, and always return ‘old’ data. To correct this you’ll want to hook into save_post and update the post … Read more

Disallow Same Post Title

Main Code Please check the auxiliary code after this block /* * Prevent Duplicated Titles * */ if( is_admin() ) // check if we are in the administrative area { add_action( ‘save_post’, ‘wpse_54258_check_for_duplicate_title’, 11, 2 ); add_action( ‘admin_head-post.php’, ‘wpse_54258_check_for_notice’ ); } /* * Checks for more than one post with the same title * * … Read more

How to add subscript and superscript in WordPress page titles

You can use markup in titles. H<sub>2</sub>O will work just fine. I would use H₂O with a real ₂ because markup will be stripped in title attributes and in feeds. Note that WordPress will not create a pretty permalink for the correct character. The slug for my example will look like this: h2o-h%e2%82%82o. You need … Read more

order by second word in title?

There is a filter, ‘posts_orderby’, which allows you to specify your own ORDER BY clauses. In your case, the code would look something like this: add_filter( ‘posts_orderby’, ‘order_by_surname’ ); function order_by_surname( $orderby, $query ) { // first you should check to make sure sure you’re only filtering the particular query // you want to hack. … Read more

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