Using files in a child theme - php

I have a WordPress site in which I am using a theme called OneEngine which uses the Aqua Layout builder. This comes with a variety of pre-made layout blocks.
The only issue I have is that by default each element is col-md-12 which doesn't give me much in the way of fine control.
So I thought I'd create some new blocks for col-md-6, col-md-3 etc
I created a child theme with the usual things
style.css
functions.php
The Layout builder plugin is in this location:
/wp-content/themes/oneengine/plugins/pagebuilder
My child theme:
/wp-content/themes/oneengine-child/plugins/pagebuilder
So, in my child theme I made a copy of the plugins folder to make my changes, however the site does not acknowledge the changes in my child theme like it does with CSS
Essentially I want my site to use the plugins within the child theme.

Related

create CMS for wordpress theme

I have converted HTML site to WordPress theme and uploaded it to the server, now i want to create CMS for this theme , but there are another active theme now and those are the the current pages.
how can I create a new page for my new converted theme without losing or effecting the current themes and the contents?
this the themes the active theme and my new covered theme
From what you describe I would advise you to create a Child Theme: https://developer.wordpress.org/themes/advanced-topics/child-themes/
Then you will be able to overrides only the templates you want if you conform to WordPress' Template Hierarchy: https://developer.wordpress.org/themes/basics/template-hierarchy/

Add a custom-made slideshow to Wordpress Theme

So i made a slideshow using HTML, CSS and JS.
It's for a personal blog i'm creating, so i would like to add the slideshow into a Wordpress theme that i purchased.
I created a child theme and tried to edit the function.php file and the style.css, and although i know some PHP it's really hard to understand how the code works and where to add mine.
Basically i want to display my slideshow initially, and then the rest of the Wordpress theme with all the posts and such.
Is it possible or should i only work with the customization options of the theme, although they're limited?
Since you've gone with a child theme, may I suggest copying a page template from the parent into your child theme?
Then you can copy your code for the slideshow via the editor into your child theme's copy of page template and use said template throughout your website for whatever page you'd like without colliding with parent theme updates.
Here's a relatively simple tutorial for creating a page template:
https://www.cssigniter.com/add-custom-page-template-using-child-theme/

WordPress Child Theme - General Understanding

I am trying to understand how to use a Child Theme in wordpress.
I am afraid that something will go wrong in the process of developpment because I haven't completely understood how to use the child theme or its integration wasn't done properly.
My confusion comes after I create the child theme and by adding the style.css and functions.php.
At this point, can I make any changes that I want to the child theme and it will still work?
For example,
After I modify the front-end of the website with the use of the child theme, I want to add some forms that will insert data into the database.
Do I have to implement any php files from the parent-theme in order to make this work ?
Or do I treat my child-theme as a fresh theme (blank canvas) and code the back-end however I would like ?
Thanks
Think of the child theme as a layer on top of the parent theme. By default (if you add nothing to the child theme other than a style.css file), all the templates from the parent theme will be used. The only thing you have to have is the style.css file. If you wanted to override the page.php template for instance, you would simply just make a page.php file in your child directory and WordPress will use that template instead of the parent template. Same goes for any template file or template part.
You can have a functions.php file in your child theme and it will be included in addition to the parent functions file.
Usually the parent's style.css file would be enqueued before the child's style.css file, but it depends on how those files get enqueued. The system is quite flexible.
Your child theme is not a blank canvas. It inherits style.css, functions.php and all the post/page templates from the parent theme. The style.css file of your child theme will load after that of the parent theme, thus enabling you to add more CSS rules. The functions.php file of your child theme will load before the parent's functions.php file.
The child also inherits all the templates from the parent. However, if a template exists in the parent and you create it in the child the child theme's template will completely override the parent's template. For more information on parent-child theme relationship I highly recommend that you check the official child themes documentation.

Wordpress: editing child theme

I want to edit some stuff on my website. I'm using a child theme and I plan to change some CSS and do some structural changes. I know the CSS is easy to change, as I only need to call the names of the classes or IDs and give the new values.
But, if I want to change things around in html, do I need to copy the whole code? Will I lose every change when the theme updates (as in: i copied and pasted the older version and now I need to copy and paste the new version)?
I don't know much about the names of things and how to describe them properly.
Make copies of the theme files in the parent theme you want to modify - such as index.php, category.php, etc - and move those to the child theme and edit them. The copies in the child theme will be used by WordPress rather than the same-named files in the parent. This includes file in folders, i.e. /css/style.css, so duplicate the file structure in the child theme, if needed.
The child theme will continue to use those files, even if/when the parent theme get updated. And that also means your child theme edits won't disappear, unless there are major structural/functional changes to the parent theme.
One exception to child theme file usage is functions.php:
Unlike style.css, the functions.php of a child theme does not override
its counterpart from the parent. Instead, it is loaded in addition to
the parent’s functions.php. (Specifically, it is loaded right before
the parent’s file.)
See http://codex.wordpress.org/Child_Themes
Taken from Wordpress Doc - Child Themes:
If you want to change more than just the stylesheet, your child theme
can override any file in the parent theme: simply include a file of
the same name in the child theme directory, and it will override the
equivalent file in the parent theme directory when your site loads.
For instance, if you want to change the PHP code for the site header,
you can include a header.php in your child theme's directory, and that
file will be used instead of the parent theme's header.php.
Wordpress Child Theme can't have a child theme itself. It's not supported by Wordpress. I had the same problem before and after some searches I found this article.
It explains about creating a grandchild theme; from the article:
The solution is surprisingly simple. Instead of editing the child
theme, create a grandchild theme. It’s very similar to creating a
child theme, except you do it via a plugin. You add your custom
functions to the plugin, just as you normally would in functions.php
(though remember your plugin will be called much earlier than
functions.php, so you’ll need to make sure that any code in your
plugin only runs when an action is fired). Use the wp_register_style
and wp_enqueue_style functions to add your CSS (by default a
grandchild theme will add your CSS to the CSS of the parent or child
theme, but you can change this behaviour by using the wp_dequeue_style
function). Finally filter the result of the get_query_template
function to control which PHP files are executed when a page is
requested.
It's not really a child theme of a child theme, but a plugin including calls to add_filters or something similar to override the behaviour of the child theme. In this way upgrading child / parent themes will not affect the customisation you've made.

Extending Theme Options to Child Themes in Wordpress

I have purchased the Honest theme. I have also created a child theme for some look/feel changes. In my child theme I have also created an additional custom post-type.
For some reason the Honest theme options are not available in my child theme dashboard. Since I have a custom post-type I don't want to simply use the parent theme because any updates will overwrite my custom post-type.
Is there a way to make the parent theme options available in a child theme? If so, can you point me toward a direction of that solution?
Hard to say without seeing the actual source code.
If you're willing to use the parent theme, you can put the code that registers the custom post type in a plugin of your own. Must-use plugins are great for this: http://codex.wordpress.org/Must_Use_Plugins
You can also put your style mods there, e.g. enqueue an extra stylesheet that overrides the styles from the parent theme: http://codex.wordpress.org/Function_Reference/wp_enqueue_style

Categories