How to Customize “WordPress > Error” Text in Titlebar?

Changing interface string is often done using gettext translation filter, but I was in the mood for something different so creatively mangled die handler to achieve it: add_filter( ‘wp_die_handler’, function () { if ( false !== strpos( $_SERVER[‘SCRIPT_NAME’], ‘wp-comments-post.php’ ) ) { return function ( $message, $title, $args ) { _default_wp_die_handler( $message, ‘Our Custom Title’, … Read more

Dynamically change page title from URL param

You could do something like this in your header.php file (or where ever you are setting your page titles in your templates) <?php if (isset($_GET[‘user’])) : ?> <title>Entries from <?php echo(htmlspecialchars($_GET[‘user’], ENT_QUOTES)) ?></title> <?php else: ?> <title>Normal page title here</title> <?php endif; ?> Without more info on what plugin you are using, or how your … Read more

How to display alt tags in img src?

You are using the Advanced custom fields plugin. The documentation for images: http://www.advancedcustomfields.com/resources/image/ To display the alt-tag for example, you can use this snippet: $image = get_field(‘image’); if( !empty( $image ) ) { $alt = $image[‘alt’]; … echo ‘<img src=”https://wordpress.stackexchange.com/questions/216629/…” alt=” . $alt .”>’ }

How to append to title via functions.php for auto-posting plugin [duplicate]

Whoa, this Plugin was a nightmare to look through. But I got a solution for you. In the description for your links, you can use the placeholder %FULLTITLE% instead of %TITLE%. %FULLTITLE% applies the filters for the title. From nxs_functions_adv.php Lines 19 & 20: if (preg_match(‘/%TITLE%/’, $msg)) { $title = nxs_doQTrans($post->post_title, $lng); $msg = str_ireplace(“%TITLE%”, … Read more

Is it possible to use multiple spaces in title?

As you can see in the Codex, the filter actually has 2 arguments, which needs to be stated: add_filter( ‘the_title’, function ( $title, $id = null ) { return preg_replace(‘#(\s{3})#’, ‘&hellip;’, $title); }, 10, 2 ); You could as well just use a placeholder that you replace on the fly – might be easier. In case … Read more

How to Orderby Comments by post title?

The WP_Comment_Query class supports ordering by: ‘comment_agent’, ‘comment_approved’, ‘comment_author’, ‘comment_author_email’, ‘comment_author_IP’, ‘comment_author_url’, ‘comment_content’, ‘comment_date’, ‘comment_date_gmt’, ‘comment_ID’, ‘comment_karma’, ‘comment_parent’, ‘comment_post_ID’, ‘comment_type’, ‘user_id’, ‘comment__in’, ‘meta_value’, ‘meta_value_num’, There’s a way to adjust it via filters so we can support ordering by the post title: $args = [ ‘status’ => ‘approve’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘orderby’ => … Read more

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