Get the title before comma

Use strtok(): return strtok( get_the_title(), ‘,’ ); You could also use my function utf8_truncate(). This is a little bit more flexible and it can handle long strings without a comma.

How do you auto-activate plugins from child themes

include this function in your theme and use this hookfunction wp_register_theme_activation_hook($code, $function) { $optionKey=”theme_is_activated_” . $code; if(!get_option($optionKey)) { call_user_func($function); update_option($optionKey , 1); } } functions and examples: <?php /** * Provides activation/deactivation hook for wordpress theme. * * @author Krishna Kant Sharma (http://www.krishnakantsharma.com) * * Usage: * ———————————————- * Include this file in your theme … Read more

Changing the HTML Of the content

The wrapping <p> is applied by a filter called wpautop. You can disable this filter and wrap the content in your desired wrapper, but it’s not really recommended. remove_filter( ‘the_content’, ‘wpautop’ ); remove_filter( ‘the_excerpt’, ‘wpautop’ ); Now you can wrap your content in a DIV for example: <div><?php the_content(); ?></div> But notice that this filter … Read more