I am using X theme from themeco, latest version. Created a custom child theme instead of using the ones made available by them. I followed all of the instructions, the functions.php file loads the activation details of the parent theme, but doesn't include the other functions it needs to load. Like header, footer or any other page, even though all of the files are included in the child theme.
Should I remove them from there and just keep the functions.php and style.css files? I will try that, if it solves the problem, otherwise, the functions are just not being there. Tried to view a test code to see which header was it even displaying, I could see the test text written where the header should be but still can't see the header.
Doing an inspection through chrome I could see lots of problems related to revolution slider, js errors, will need time to debug them but would love if anyone got a quick fix for it without me racking brains all over the place.
Edit:
Code
Related
I have added two custom written functions to my wordpress code.
One of them uses the add_action() and the other uses the add_filter() function of wordpress.
After deploying the code, both functions work as expected, but after some time (I am not sure how long it takes and what causes wordpress to do so) the code just magically disappears from the file.
I am now wondering
Why is this happening?
What can I do so that this won't happen again?
Thanks for your help
Hey you just mentioned that you've added code into /wp-includes/functions.php file. You've used action and filters that's good but your code should be go into active theme's (child theme is the best practice) functions.php file. Files under /wp-admin/ and /wp-includes/ get updated automatically from WP when new update is available (based on settings you have done on your WP setup you can ignore updates as well).
So, your code must be removed by update. Files were overridden by updates. If you have backup copy those code and put it into active theme's functions.php file /wp-content/themes/yourtheme/functions.php is the correct file where you can add the code.
If you have added code into theme's functions.php file make sure you didn't get theme updated otherwise you may lost your work as well that's the reason you can use the Child theme. You can learn how to create child theme here: https://developer.wordpress.org/themes/advanced-topics/child-themes/
Why is this happening?
Most probably because someone updated WordPress to latest version. Before you are going to tell me "but I did not press anything, ever!" please bear in mind, that WordPress updates itself automatically. Especially in the newer versions.
Here is nice article about WordPress automatic updates. It also describes how to turn this off, but I do not recommend doing so.
What can I do so that this won't happen again?
Develop custom WordPress plugin, containing your customizations. Here is nice step by step tutorial
you shouldn't make any changes into wp-includes and wp-admin folders, these folders will update automatically if your wordpress is updated. so if you want to make any changes using hooks and actions you can place the code into your current theme's functions.php. that will work as expected and your code won't disappear.
Recently, when I view a page in Wordpress Preview mode, it always loads the default template (theme page.php file) whereas when I look at the published page, it's the right template. I have around 10 different templates for my pages. Just keep in mind that I'm not talking about the theme itself, but the Wordpress template structure. I included three pictures. The admin panel one, shows different templates for my page.As shown, I chose Fixed-Width Clean Page. The second picture shows the page in Preview mode.As you can see it includes a sidebar which is included in the default template but not the one that I chose. And the last picture is the Live view of the website which is correct. As you can see the sidebar doesn't exist. I searched all over the internet and did some suggestions, but none of them work (like saving the permalinks again, changing the theme and changing it back again, etc). The only change that I recently made was upgrading to Wordpress 4.7.4 and blocking access to admin panel by ip using .htaccess file (I removed the .htaccess file, but still no luck). Any suggestions would be appreciated.
OK, after some time I figured out what the problem was. The "WP Subtitle" plugin version 2.9, breaks the preview functionality if you have multiple templates. I report the issue to them as well, but posted the answer if somebody came across the same problem. In order to fix the issue temporarily, i commented out the below line (line 74) on the plugin's main file (wp-subtitle.php):
//add_filter( 'the_preview', array( 'WPSubtitle', 'the_preview' ), 10, 2 );
I'm by no means a coder or programmer but i have enough to understand my part and fix small issues or adjust look with basic CSS, and so friend of mine asked me for help and here i am two days later asking you)
There is a Website running Enfold theme which recently were updated and so was lost custom image link at right part of header made by someone-else.
I have restored link code from Cached version of website but have no real understanding how and where to add it back to theme templates. Would appreciate any help, solution, link, advice.
Cheers.
A wild guess, since I don't have Enfold theme (the best would be to ask on the official support), but in your div #header_main in the .inner-container, you had after the #advanced_menu_toggle this piece of code:
<img src="http://vcmt.ca/wp-content/themes/enfold/images/layout/canvas.jpg" alt="canvas" style="max-height:70px;">
Just open the .php file that has the header in it, and paste this code back in. Since the canvas.jpg was located in the /images folder of the theme, that is also gone, so my recommendation is to download the image from the cached version if you can and put it back in the image folder.
Also it would be better to make changes to child theme, so that you can update the functionality of the theme, without loosing any custom added modification, like this site had.
If you're planning on changing the CSS in any WordPress Theme, you want to make sure that you have a child theme installed. The child theme allows you to change/overwrite the CSS and Theme Functions on the theme without losing those changes everytime the theme updates.
You can download the Enfold Child Theme Here:
https://kriesi.at/documentation/enfold/how-to-install-enfold-theme/#why-child-theme
...and if you need to add HTML to the header, you can do so by duplicating the header file from the theme, adding a header file to the child theme, and making your changes in the child theme header file.
Hope this Helps!
I'm new to WordPress and actually repairing a page as a favour. The page was originally created by an inexperienced developer which is why it has its faults.
My main concern is that I don't seem to get any of the plugins to work. The page has a custom theme. I tried switching to a previously uploaded theme and all the plugins worked like a charm on that.
The client seems reluctant to abandon the custom theme and short of having to take it apart piece by piece I'm trying my luck here.
Both wp_head() and wp_footer() are called and seem to be in the right places, wp_head() right before the </head> tag and wp_footer() right before the </body> tag.
What am I missing?
This is a very general question, but here are some starting steps to try and see how you get on...
In wp-config.php add or alter the following: define('WP_DEBUG', true);
This enables debuging to screen and will throw up any errors.
I would still advise you then try the plugins one by one - in theory once you get one working then the others should be ok. There is more to a theme than just having wp_head() etc... make sure the loop is in place and things like get_sidebar(). Compare whole pages to those of a working theme.
I'm running into a bunch of problems with a 'premium' WP theme I purchased. The developers aren't being a very big help besides 'it should work' and 'it works for other people' so I'm just trying to figure it out myself.
Chrome's Dev tools have been my biggest friend so far. The problem I am having with this theme is that my style changes aren't being applied. Now there are three different locations where I could do this. One is style.css another one is custom.less and the 'quick css' box that comes packaged with the theme. Neither of these options work - sometimes some changes will be applied from style.css - but most of the time my changes are not applied. I have started digging in the source (parent) files and started changing those and again - no change.
Now I found out with the help of chrome's devtools that the header file refers to the stylesheets with version numbers. The moment I removed the version number from fw-style-css all my changes were fed through immediately. Now I would like to know where in WP I will have to start digging to get to the header part where I can change the stylesheet details. I already looked up header.php but it refers to and I have no clue what to do after this.
The website in question is just a testing environment until I have everything sorted out, then I will port it over to my main site. The website in question is http://dev.amyranth.com/
If the stylesheet files aren't directly linked in the header.php file, then the stylesheets must be included via the wp_enqueue_style function. Example:
<?php wp_enqueue_style( $handle, $src, $deps, $ver, $media ); ?>
The fourth parameter is "version" which is most likely what you saw in the source code. You should change this every time you make a change to the stylesheet because it will help with browser caching by forcing the browser to download a new version of the file. Otherwise, it will assume that the old cached copy of the stylesheet is still valid.
Update:
The best way would be to do what #ViperCode suggested and create a new stylesheet, then add it to the theme with wp_enqueue_style.
In fact, the very best way would be to create a child theme which extends the premium theme you are trying to customize. That way your changes would be maintained separately and would not be overwritten by theme updates.
The easiest solution would be to search your theme's directory for the function name wp_enqueue_style