Index showing source code

The problem was at .htaccess In the plugin w3 total cache I had enabled the option page cache, disk enache I switch to Disk basic. Then at the .htaccess it removed this code # BEGIN W3TC Page Cache core <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule .* – [E=W3TC_ENC:_gzip] RewriteCond %{HTTP_COOKIE} w3tc_preview … Read more

Using add_rewrite_rule() to redirect to Front Page

Found the solution in this thread: How to prevent the default home rewrite to a static page Just disable canonical redirect for front page: function disable_canonical_redirect_for_front_page( $redirect ) { if ( is_page() && $front_page = get_option( ‘page_on_front’ ) ) { if ( is_page( $front_page ) ) $redirect = false; } return $redirect; } add_filter( ‘redirect_canonical’, … Read more

How to show taxonomy meta on frontpage?

Over at Google+ I posted the same question and credits go to Alexander Conroy for coding up the correct solution: /* List all blogs, source example 2: http://codex.wordpress.org/Function_Reference/get_terms#Examples * * credits Alexander Conroy – https://plus.google.com/u/0/113053085239726972447 */ $terms = get_terms(‘blog’, $args); $blog_image_meta = get_option(‘blog_image’); if (!empty($terms)) { foreach ($terms as $term) { $meta = isset($blog_image_meta[$term->term_id]) ? … Read more

Load front-page.php from subfolder

You can make use of the frontpage_template filter to adjust where your template should be loaded from add_filter( ‘frontpage_template’, function ( $template ) { $locate_template = locate_template( ‘page-templates/front-page.php’ ); if ( !$locate_template ) return $template; return $locate_template; });

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