Wordpres and git - config tweaks


switch ( $_SERVER["HTTP_HOST"] ) {
 case "caj.local" : /** Local Config **/
  define("DB_NAME", "<local databasename>");
  define("DB_USER", "<local username>");
  define("DB_PASSWORD", "<pass>");
  define("DB_HOST", "localhost");
  break;
 case "caj.donkeymedia.eu" :
  /** Testing Server Config **/
  define("DB_NAME", "<testing databasename>");
  define("DB_USER", "<testing username>");
  define("DB_PASSWORD", "<testing pass>");
  define("DB_HOST", "localhost");
 break;
 case "caj-koeln.de" :
  /** Life Config .... **/
 break; 

Wordpress plugin Cachify cache clear

The Wordpress Plugin Cachify provides a very fast render cache for annonymus users, but it lacks a method to clear the cache if the user is not admin. This tiny plugin solves this issue.

Tags

Disable Update for Wordpress Plugin


add_filter('site_transient_update_plugins', 'ap_remove_update_nag');
function ap_remove_update_nag($value) {
 unset($value->response[ plugin_basename(__FILE__) ]);
 return $value; 
}
Tags

How to remove the depreceated target="_blank" in Wordpress TinyMCE?

/** Creating custom :external selector **/
$.expr[':'].external = function(obj){
 return !obj.href.match(/^mailto\:/) && (obj.hostname != location.hostname); };
// Add 'external' CSS class to all external links.
$('a:external').bind('click', function(){
 open(this.href);  return false;
});

Tags

WORDPRESS: Add CSS to Tinymce Editor

if ( ! function_exists('tdav_css') ) {
 function tdav_css($wp) {
   $wp .= ',' . get_bloginfo('stylesheet_directory') . '/css/tinymce.css'; return $wp;
 }
}
add_filter( 'mce_css', 'tdav_css' );
Tags

Worpress Plug-in: Multilingual Contact Form

With Wordpress and the qtranslate plug-in it is easy to create multilingual websites for small business. My favorite contact form plug-in was discontinued I needed some replacement, which is usable on a multilingual site.

Make All in One SEO and qtranslate work together

In the main Plugin file all_in_one_seo_pack.php on lines #709 and #711, the $title_attrib and $menulabel variables are not created as Multilingual Variables. In order to make them so you need to add __() around the variables:

#709 :

$filtered = '<li class="page_item page-item-'.$postID.$matches[2].'"><a href="'.$matches[3].'" title="'.__($title_attrib).'">'.__($menulabel).'</a>';

#679 :

Easy Jquery Syntax Highlighter

Searching for a proper syntax-highlighter for my Wordpress Blog is not an easy thing. Many of them support only a few browsers, mass around with XHTML standards or make extensive use of libraries like prototype I don't want to add to my site.

Same template for Category and Subcategory

Using the same template file for a category and its children is not possible with Wordpress. In order to do you need to use Elevate Parent Category Template-Plugin. If you using the Plugin you'll be able to use some adittional template functions:

Tags