New answers tagged

0

Why not use a completely separate repo for each child-theme site once its established? Clone the master repo when spinning up the environment, remove the Git directory, init a new Git repo, and push it up to wherever? Now each child theme can be developed independently of each other. Alternatively, if you're using the same site as a base and making minor ...


-2

I don't know why you wanna do that, but.. We can use min-height with vh (view port height) unit for this. Setting height of the page to 100vh means we are saying the page to fill the full view port height. .site { min-height: 100vh; } But this doesn't work well with iOS7. So work around is. /** * iPad with portrait orientation. */ @media all and ...


0

All settings are stored under child theme domain, so no worries. Just make sure you maintain the same parent theme folder name after updates. You could always backup the old one by renaming its folder.


2

As Caspar has alluded to in a comment, a child theme descends from a parent theme - you wouldn't add a pre-existing child theme on to a parent theme the same way a parent human is needed to make a child human ;) The theme you are working on now is a parent theme, whether it came from another theme base originally or not. You have two ways forward: You ...


2

If you're sure you don't need those plugins and if TGM is not tied up with any required licenses for your plugins, just pull TGM Plugin Activation right out. It's a three step process. One: find and delete the plugin registration function. <?php /** * Required and Recommended Plugins */ function prefix_register_plugins() { /** * Array of ...


1

All the information you need can be found here: https://codex.wordpress.org/Child_Themes The important parts to get it up and running would be to: Make sure the parent theme exists (the complete accesspress-lite theme in your case) Create a unique folder name for your child theme. Create a style.css file in your child theme folder. /* Theme Name: Your ...


1

You need to create attachment.php in your child theme. Please check here for more details.


0

In general you can not override functions or methods in PHP. Code can be written to support such things, but it needs to be planned in advance, and your snippet is not big enough to be able to decide if it is possible or not in your case. The good thing, is that you do not need to override any function at all as the output of that function is filterable by ...


0

In your child theme's 'functions.php' file, you need to use the 'remove_action( 'widgets_init', '$name' ); script. For instance, in your twentytwelve-child theme's 'functions.php' file, use: remove_action( 'widgets_init', 'twentytwelve_widgets_init' ); //necessary to replace parent theme's code and then hook your new widget in your child theme's function ...


0

Depending on how the main class is set up, you can create a child class of the parent class. Something like: class Custom_Post_Type_Child extends Custom_Post_Type { { public function doSomething ( $var ){ return $var; } }


1

Your child theme functions.php loads before the parent theme's, so you're trying to remove the action before it's added by the parent theme. Hook after_setup_theme to remove/add, which is executed after both child and parent load. add_action( 'after_setup_theme', 'wpd_wp_head_function' ); function wpd_wp_head_function() { remove_action( 'wp_head', ...


3

Here you go. Since you already have the menu-id all you need is: $menu_item_defaults = array( 'menu-item-db-id' => $menu_item_db_id, 'menu-item-object-id' => 0, 'menu-item-object' => '', 'menu-item-parent-id' => 0, 'menu-item-position' => 1, ...


0

TLDR answer: first parameter of each wp_enqueue_style() should not be left as 'parent-style' and 'child-style'. They should be renamed to match the name of the parent theme and its child. Problem If you don't rename the parameters, you will get the child theme enqueued a second time can result in rules appearing twice in Firebug and changing values in the ...


0

I have a workaround for you that may be better than just writing modifications in parent theme files which is of course not desirable for reasons Otto mentioned. If you add these two lines of PHP the top of any file you want to use a modified copy of in your in your child theme directory structure: <?php $filepath = ...


1

I agree with @Zlatev that you probably wouldn't want to do this clientside. There are easier ways to include less. There are plugins that allow you to do this. Even jetpack has less support. If your goal is to include this in your theme you can use wp-less. Just download that plugin and drop in somewhere in your theme and include it in your ...


2

Child themes are allowed to override templates, not simply arbitrary PHP files. In WordPress, a theme consists of a bunch of PHP files which are used as Templates. You can find a list of those files in the Template Hierarchy. Those specific template files can be overridden with new ones, but unless the parent theme has some special means for you to ...


0

In /wp-content/themes/centric-pro/style.css, delete line 88 through line 113 this removes all the font-face declarations. On line 88 paste the following: @font-face { font-family: 'GothamRounded-Bold'; font-style: normal; font-weight: 400; src: url('fonts/GothamRounded-Bold.eot') format('embedded-opentype'), ...


0

Your parent theme (if you built it) should be using get_template_part() instead of require_once(). Using get_template_part() is functionally equivalent (actually, it's better) and will allow the override ability you're expecting. I'm assuming the THEME_PATH constant does not account for whether the active theme is the child or parent, and therefore, the ...


1

In regard to WordPress post paged, I would use /player-12345 or other structure as url specific page rather than /player/12345. How to create new url structure for page Creating additional url structure, you need WP_Rewrite, there are a couple of filters that you can fire with your function. For Page, you can filter page_rewrite_rules. See example code on ...


2

You can add a filter to page_link to modify link output: function wpd_add_fragment_to_pages( $url ) { return $url . '#navbar'; } add_filter( 'page_link', 'wpd_add_fragment_to_pages' );



Top 50 recent answers are included