Place page title in header?

If you only need the title you can request it outside the loop easily. Try and call the_title() in your header. It should work But you have to be aware that if you don’t put a condition, each page of your website will display its title in the header section. EDIT: the function to call … Read more

Problem in wordpress with “-“

Background: WordPress converts normal dash (-) to long dash (–), straight quotes to curly quotes and some other similar symbols and punctuations to their printer friendly versions using wptexturize. Generally it’s recommended to leave them up to WordPress. However, occasionally, we may want to override this behaviour. For example, in case we are writing Programming … Read more

Remove wptexturize from a shortcode?

There is a clue in wp-includes/formatting.php in the function wptexturize: $default_no_texturize_shortcodes = array(‘code’); … $no_texturize_shortcodes=”(” . implode(‘|’, apply_filters(‘no_texturize_shortcodes’, $default_no_texturize_shortcodes) ) . ‘)’; Try using this filter to add a shortcode to the array: function my_no_tex( $shortcodes ) { $shortcodes[] = ‘someshortcode’; return $shortcodes; } add_filter( ‘no_texturize_shortcodes’, ‘my_no_tex’ );

disable WP automatically inserted line breaks after an image

If this is how it looks: <img class=”alignleft size-medium wp-image-8530″ alt=”…” src=”#” width=”413″ height=”275″ /> <img class=”alignleft size-medium wp-image-8529″ alt=”…” src=”#” width=”413″ height=”275″ /> Then you have to put them together like this: <img class=”alignleft size-medium wp-image-8530″ alt=”…” src=”#” width=”413″ height=”275″ /><img class=”alignleft size-medium wp-image-8529″ alt=”…” src=”#” width=”413″ height=”275″ /> Because if you do this … Read more

Formatting Code Snippets on Free WordPress.com Account?

wordpress.com supports code syntax-highliting. You can read all about it here: http://en.support.wordpress.com/code/posting-source-code/ for your specific example use: [sourcecode language=”java”] package com.jameselsey.domain; import java.util.ArrayList; import java.util.List; import com.google.android.maps.GeoPoint; import android.app.Application; /** * This is a global POJO that we attach data to which we * want to use across the application * @author James Elsey * … Read more

How to change text size of Gutenberg editor

If you came here, like me, looking for how to adjust the available text size options within Gutenberg, you can add this code to your theme’s functions.php file (you can add as many options as you like): add_theme_support( ‘editor-font-sizes’, array( array( ‘name’ => __( ‘Normal’, ‘your-theme-text-domain’ ), ‘shortName’ => __( ‘N’, ‘your-theme-text-domain’ ), ‘size’ => … Read more

remove tags from the_content

By default, WordPress adds paragraph tags to category descriptions. Stop this by adding the following to your functions.php file // Remove p tags from category description remove_filter(‘term_description’,’wpautop’); Simple and easy (codeless). Thank you

Nice way to print_r arrays

I created a Kint plugin that works really well. I also integrates with the Debug Bar plugin. You can download it at: http://wordpress.org/extend/plugins/kint-debugger/ There are a few functions to help you out with WordPress specific globals: dump_wp_query() dump_wp() dump_post() For printing arrays in a styled, collapsible format you would do the following. $foo_bar = array( … Read more

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