Disable title link in the backend for non-admins

I believe the links below achieve what you’re looking to do when they’re combined. If you want to have administrators or just specific admin IDs excluded you could add to the if statement in the function like I have done with current_user_can function; function perm($return, $id, $new_title, $new_slug){ global $post; if($post->post_type == ‘testimonials’ && current_user_can(‘manage_options’)) … Read more

Display category page number links for older posts

First, that old site is not any version of WordPress. Second, don’t hack TwentyTwelve, make a child theme. if you hack it, your changes will be lost when the theme is updated. Third, the easiest way to achieve pagination like that would be WP-PageNavi.

How to auto strip hyperlinks & images in wordpress post

Here is one idea to strip link- and image tags from the post content (before you save it) by using the edit_post_content filter and the wp_kses function: add_filter( ‘edit_post_content’, ‘my_edit_post_content’, 10, 1 ); function my_edit_post_content( $content ) { if (!current_user_can(‘manage_options’)) { // only strip for non-admins global $allowedposttags; $mytags = $allowedposttags; unset($mytags[‘a’]); // don’t allow … Read more

Internal linking to posts permalink fail because of spaces and stripe at postname

Spaces are invalid characters in URLs. Your links are broken, whether the posts exist or not and regardless of whether you want the spaces or not. And uppercase/lowercase can get you in trouble too. Some servers are case sensitive so if you have a permalink to http://somesite.com/hello-world a link like http://somesite.com/Hello-World might work or it … Read more

Automatically deactivate link for attachments

With markup embedded into the content there is no less tricky way than regex to do it, save perhaps a markup parser like SimpleHTMLDom function remove_image_link_102512($content) { $pattern = ‘|<a.*?href=”https://wordpress.stackexchange.com/questions/102512/(.*)”.*>?(<img.*?/?>)(?:</a>)?|’; $content = preg_replace($pattern,’$2′,$content); return $content; } add_filter(‘the_content’,’remove_image_link_102512′); As with all regex + markup solutions, I’d test that thoroughly. Of course, as no saved data is … Read more

Link a widget or find the php that creates the widgets

If the widget is part of the wordpress core, you can see its source in wp-includes/default-widgets.php. If it came with a theme or plugin, you can find the code there. Sometimes widgets will be in an obviously-named widgets.php, but other times you’ll have to hunt for them. At some point, each widget has to be … Read more

Simple form to add custom links to menu?

Well, since you’re talking about a widget of Links…. why not just use the default Links widget that was part of core up till 3.5? http://wordpress.org/plugins/link-manager/ If you insist on limiting it to showing the latest 5 links, you’re going to have to write a bit of code (that I’m not convinced is worth it). … Read more

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