Tag Info

Hot answers tagged

20

You should run the code after theme setup. function osu_twentyten_continue_reading_link() { return ' <a href="'. get_permalink() . '">' . __( 'Read on <span class="meta-nav">&rarr;</span>', 'twentyten-child' ) . '</a>'; } function osu_twentyten_auto_excerpt_more( $more ) { return ' &hellip;' . ...


13

Hybrid Theme Hybrid, developed by Justin Tadlock. Scope of code is primarily PHP internal functionality and front-end templates for themes. Interesting features: code aims to minimize template edits, most of functionality can be controlled via hooks; context-aware - extended body-class, dynamic context-aware hooks that allow to hook events that fire only ...


8

Overriding that template would be much easier than getting rid of it. Just the way logic goes. I make no claim it's efficient idea (late here), but this would get it nuked from edit screen: add_action('admin_head-post.php','remove_template'); function remove_template() { global $wp_themes; get_themes(); $templates = &$wp_themes['Twenty ...


8

Expanding on @Rarst's answer, here's a more generic approach that is not tied to a specific theme, but can be used inside your own child theme's functions.php to nuke any parent theme page templates you want to get rid of. function remove_template( $files_to_delete = array() ){ global $wp_themes; // As convenience, allow a single value to be used ...


8

Child Themes are useful for users who mainly want to make style changes to their Theme, but don't want - or know how - to maintain the underlying code. Grokking PHP/WordPress Theme Development is an entirely different thing than grokking CSS. Child Themes are also useful for users who want to implement minor functional changes to their Theme. This is ...


7

Kind of - the template_directory is the directory of your parent theme. The stylesheet_directory is the directory containing the primary stylesheet in use (which, if you have a child template will be the in the child directory, otherwise it will be in the template directory). See the Codex here: 'stylesheet_url' - Returns the primary CSS (usually ...


6

Just FYI, this question probably borders on too localized, as it is specific to the Oenology Theme. That said, here's where I think you're having a problem: Oenology enqueues two style sheets: style.css, directly in the document head (thus before wp_head() is fired) {varietal}.css, at wp_enqueue_scripts, with priority 11, in functions/dynamic-css.php: ...


6

In addition to Chip Bennets answer Some developers like myself have their own custom frameworks or are using one like Genesis, Hybrid, etc. Those frameworks don't bundle too much styling, but more functionality like their own templating and hooking mechanisms. Sometimes also stuff like CPT or CT base classes, meta box libraries, css frameworks, etc. It's ...


5

One of the biggest uses for child themes is in MUWP instances. Often, in a multisite install, the related sites share some or most of the theme, but may need to have some custom page layouts or element styles. In this case, it makes a lot of sense to use child themes. Elements that are the same are addressed in the parent theme (which may in fact be a custom ...


4

WordPress 3.9 introduces a theme_page_templates filter. The example below from a Twenty Fourteen child theme functions.php shows how to remove the "Contributor Page" template: function tfc_remove_page_templates( $templates ) { unset( $templates['page-templates/contributors.php'] ); return $templates; } add_filter( 'theme_page_templates', ...


4

Canvas Purpose Advanced standalone/parent theme, uses WooFramework. For sketching out sites and concepts. Building a version 1 without having to do so from scratch. Strong features I find the theme code very easy to hack for my purposes. Canvas uses a lot of new HTML and CSS features in a smart way. Downsides Not free (but free software) ...


4

Generally speaking, Child Themes were originally intended to be able to do two things: Override parent Theme CSS Override parent Theme template files I doubt that the Theme developer intends for the /function-includes/theme-functions.php file to be overridden by a Child Theme. Functional files are usually a core component of the Theme, and allowing a ...


3

You can enable child themes for any theme: http://codex.wordpress.org/Child_Themes If you want your parent theme based off another parent theme, for example you want a theme based off of Twitter bootstrap and apply any changes they make to your framework, without over-riding your changes, use revision control. Git Mercurial etc.


3

It depends entirely on a) what functions and template files you're talking about, and b) how those functions are defined, or template files are called, in the Parent Theme. If the Parent Theme uses get_template_part(), then you're golden. If the Parent Theme uses get_stylesheet_directory_uri() or STYLESHEETPATH, then you can override, with caveats. If the ...


3

Your site is not using a Child Theme. It is currently using the WordFruit Theme, and this Theme does not declare any Theme as a Template. If it were, you would see a Template: parent-theme header tag (where "parent-theme" would be, e.g. twentyeleven if it were using Twenty Eleven as its parent Theme) in style.css Thus, WordFruit appears to be a stand-alone ...


2

Not using the current system. In order to serve as a valid Template for a Child Theme, the Parent Theme must exist, and be a valid Theme. That's because the Parent Theme's template files must be accessible via locate_template(), in order for the Child-Parent fallback to work properly. Note: if this core Trac ticket is implemented, then you'll be able to ...


2

On your wordpress menu use another class instead of "blog" for the blog item, cause your theme has a function that add a similar class to the body so it's creating a conflict in there, try erasing your blog class for you to notice. Also the app.css if for ur custom css :), no need to use both.


2

That's pretty simple: You're trying to get the parent property from the $post object, but that is either NULL or simply not attached. In both cases, you are Trying to get property of non-object from the $post object. Simply check if ( isset( $post->parent ) ) { /* do stuff */ }.


2

There's a new filter in WP core (3.9) to remove page templates. It can be used from child themes. Here's how to achieve this in TwentyTen (tested on WP 3.9): add_filter( 'theme_page_templates', 'my_remove_page_template' ); function my_remove_page_template( $pages_templates ) { unset( $pages_templates['onecolumn-page.php'] ); return ...


2

SWIFT On my private blog i use : http://swiftthemes.com/ purpose: standalone theme but child themes are supported with demo childtheme Kill Bill theme included strong features: out of the box it includes a real handy template adjustable in the end user menu system nice friendly creater and user community its easy to understand and easy hackable which ...


2

While I agree with Justin Tadlock on a lot of things, I strongly disagree with him on this. The reason parent/child themes exist is that there's a lot of common functionality used across websites. Instead of re-inventing the wheel every time, it's better to build from a solid base that has been tested by hundreds of developers and used on tens of thousands ...


1

Is this even possible? If your description is correct and ... The function is not pluggable, by which I assume you mean not wrapped in a if (!function_exists()) condition and The function is not a callback for an action or a filter and The function is not in a theme file that gets automatically substituted by the template loading system ... then you ...


1

Of course right after I post this, I find an answer...so hopefully someone else can benefit from this. For me, the answer was instead of unregistering nav menu items, I needed to just remove the action...so my function now looks like this: function remove_cornerstone_menus() { remove_action('init', 'cornerstone_menus'); } add_action('init', ...


1

Here is what worked: add_action( 'after_setup_theme', 'parent_override' ); function parent_override() { unregister_sidebar('sidebar-4'); /** I have looked for the ID of the sidebar by looking at * the source code in the admin.. and saw the widget's id="sidebar-4" */ register_sidebar(array( 'name' => 'Footer', ...


1

Create a separate directory and a (sub) domain for your themes. Lets say the domain is themes.example.com, and the directory is /extra/wp-themes/. Now let all your installations use the new theme root. Or just do the same for plugins to manage all plugins from one place too. Registering a new theme root is not possible with constants, you will need a ...


1

Functions.php is shared for parent/child themes unlike other files which will be overridden. What that means is that WordPress will load both the parent and the child functions.php. In your case it sounds like you would simply create a child functions.php and then a create new register_sidebar . Then use dynamic_sidebar whenever you want in your theme ...


1

Answer remade. The original was a wild idea... The solution is the same as the one posted by Rarst in the question linked How to *remove* a parent theme page template from a child theme? Difference being the admin_head hook. And a check for only running in edit-page and not in edit-post or edit-custom_post_type, as all these cases are fired by ...


1

if it the functions file, the child theme is loaded in conjunction with it's parent, the child being loaded first. If its the index.php file, you need to make sure your WordPress version greater than or equal to 3.0. Otherwise, your index.php file won't overwrite. A lot of reworking of themes has happened in the last year, so make sure you check out ...


1

Handle all the class loading in your parent theme on a predictable action (point in time) and hook in later in your child theme. Example: add_action( 'wp_loaded', 'parent_prefix_load_classes', 10 ); function parent_prefix_load_classes() { $classes = array ( 'Extra_Comment_Walker', 'Extra_Nav_Menu_Walker ); foreach ( $classes as $class ) { ...


1

You can use <?php get_template_directory_uri(); ?> to reference your parent theme folders. From the WordPress codex: In the event a child theme is being used, the parent theme directory URI will be returned...



Only top voted, non community-wiki answers of a minimum length are eligible