How do I replace title with my plugin?

Please try this code hope it will solve your problem. add_filter( ‘wp_title’, ‘theme_custom_title’, 20 ); function theme_custom_title $title ) { return str_replace(‘your old title’, ‘your New title’, $title); } // changes the “Enter title here” to “Enter some New title” add_filter(‘gettext’, ‘custom_rewrites’, 10, 4); function custom_rewrites($translation, $text, $domain) { global $post; $translations = &get_translations_for_domain($domain); $translation_array … Read more

Incorrect data after modifying post using backlink from wp_die

I don’t know why this issue occurs. The back_link is created in /wp-includes/functions.php. If there were a Javascript solution, it could be applied in the message of wp_die. For example: $msg = ‘Error’ . “\n<p><a href=”https://wordpress.stackexchange.com/questions/80375/javascript:history.go(-1)”>$back_text</a></p>”; wp_die($msg, ‘Error’, array( ‘response’ => 500 )); But this didn’t work… What I saw is that the Title and … Read more

How to make plugin work in each template in wordpress

You would have to put your code in your question into a function. Maybe something like function wpse_91897_get_image() { }. Then try the code below. I haven’t tested this but it should work. function wpse_91897_display($content) { global $single; $output = wpse_91897_get_image(); if (is_single()) { return $content . $output; } else { return $content; } } … Read more

prepopulate form from a hook within wordpress function.php file

You will need to declare the variable global before using it. function simple_form(){ global $firstname; $firstname=”Bob”; //Do something to populate the form field name <fname> with “Bob” } Your form should be able to do … global $firstname; echo $firstname; … to use the variable. However, I can’t help but think there is a better … Read more

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