Articles of themes

How to Insert Shortcodes into Theme?

I have content locker plugin. For locking contents, im using this shortcode: [wp-like-locker] Your locked content here… [/wp-like-locker] and I need lock every post on my blog. How could I instert this shortcodes into theme and lock: Thank you very very very much for your answer and time!

Changing the template hierarchy

Is there an easy way to change the WP default template hierarchy? For instance; Say I want to change my theme directory structure so that it completely changes from the Template Hierarchy suggested here based upon conditionals: http://codex.wordpress.org/Template_Hierarchy If I wanted to make sure that for all page types (is_single() is_home() etc) it always opens […]

How to use get_page_by_title() with qTranslate?

Any idea how I can use the WP function get_page_by_title() with qTranslate installed? for example: $page_contact = get_page_by_title( ‘_e(“[:en]contact”);’ ,’page’ ); $page_contact_ID = $page_contact->ID; echo ‘~~~~’.$page_contact_ID; The only way I can get a match is by including the whole string with all the languages – and there is no way that’s going to work once […]

Which themes do you use to test compatibilities with your plugin

When developing a plugin, I usually test it with the following themes before public release: TwentyTen by Automattic TwentyEleven by Automattic Coraline by Automattic Duster by Automattic Hybrid by Justin Tadlock News by Justin Tadlock Prototype by Justin Tadlock Retro-fitted by Justin Tadlock Responsive by ThemeID PageLines by PageLines Buttercream by Caroline Moore Catch Box […]

file_get_contents Not allowed in Themes?

I’m using file_get_contents in a theme development (in a widget of the theme). However the theme check plugin gives me following warning: WARNING: file_get_contents was found in the file file.php possible file operations. Line 49: $data = file_get_contents ( ‘http://example.com’); Line 62: $count= file_get_contents ( $cfile ); My question is that if it is not […]

How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)

I’ve created my own theme based on a very lean template. My theme is not parsing the markup to the correct html. It’s just showing the text without any markup around it. Here are the relevant observations for my situation: When editing the post it shows in “Text” mode, and a nice image with caption […]

Can i have a single wordpress site to have two themes ( one for pc other for mobiles)

I have a wordpress site say at www.demo.com, now I have two themes one which I want to use this user is acessing the site from “PC” (computer) and a another theme, which is a full fledged mobile theme to be used only when the user is accessing from a mobile device ( such as […]

How to remove a file included in parent theme with locate_template() via child theme?

In my theme I use locate_template() to load the various parts of my functions library. I’m looking for a way to not include one of those files when using a child theme. I tried adding locate_template(‘same_file_name.php’, false); to my child theme’s functions.php but it is still included. CLARIFICATION EDIT: I don’t want to prevent this […]

Theme Check: Could not find post_class

I’ve inherited a theme from a another developer that I’ve re-styled for a client. We’re just about finished, but I thought I’d run it through the Theme-Check plug-in to see if there’s any errors or problems. Unfortunately there’s a ton. I’ve gotten rid of most of them, but I have one Required left: REQUIRED: Could […]

$wp_customize->remove_section for customizer setting?

I use an underscores theme and try to remove the nav menu without any result : $wp_customize->remove_section(‘colors’); // works $wp_customize->remove_section(‘background_image’); // ok $wp_customize->remove_section(‘header_image’); // ok $wp_customize->remove_section(‘static_front_page’); // ok $wp_customize->remove_panel(‘widgets’); // ok $wp_customize->remove_panel(‘menu_navs’); // not ok $wp_customize->remove_section(‘menu_navs’); // not ok What’s wrong ?