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.
Related
I recently uploaded my website online and following that, I want to edit a few new things but as shown in the image above, the page has no style. The wordpress theme I bought is heavily relying on templates and the only way to edit them is through the customizer but I am trying to look for a solution and seem to find none, is there anything that can be causing this? I deleted all plugins that are not needed incase it was some plugin breaking it but that does not seem like the case.. any help?
sidenote: in the localhost the customizer works fine, its just that when I published it online when this issue has occured.
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.
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
I really hope someone can help me with this, it is driving me mad. I have installed WooCommerce on an off-line test site on a default theme (TwentyThirteen) and it works and looks great.
When applying it to a theme I have developed however, the styling of the products completely break and display in a vertical list, with the links styled as per the rest of my page.
I've tried all the instructions on the WooCommerce website to integrate it to my theme (both methods of either using a catch all page, or adding hooks), and all of this still results in the same broken layout.
Now, through many hours of looking in to this and comparing my theme to that of TwentyThirteen, I have noticed that when I render the page, the '
ul and li tags of the products on TwentyThirteen theme are using woocommerce.css, and on mine just the styles I had already set.
So for some reason TwentyThirteen theme can look at the woocommerce stylesheet, and my theme can't. All the settings for WooCommerce are identical as I am just switching themes.
I have declared my style.css in my header but nothing else regarding enqueuing scripts etc. Is this where I am going wrong? And if that is the case could someone point me in the right direction on what to put either in my header or functions.php please to make it work? I seem have no trouble with any other plugin I use on my own theme.
Thanks for your time reading this and any advice you can give me. :)
Make sure you have body_class() into your <body> tag like this :
<body <?php body_class(); ?>>
I installed a new plugin (optimizely) on my Wordpress site. I need the new plugin and it isn't optional. However, since installing it, the shortcode on another plugin (download monitor) no longer works.
All the downloads that I had in my posts just disappeared.
the php shortcodes in my posts look like this: [download id="2981"]
I tried deactivating the optimizely plugin, but it doesn't make a difference. I think something got changed in the settings of wordpress??? This is my guess. The odd thing is that optimizely uses php short codes as well, so it can't be that short codes are no longer active...
Can anyone tell me where I should look?
UPDATE:
I also have Jetpack installed... which has a features called shortcodes. I just tried to insert a YouTube video in to a post using their shortcode format and it didn't work either!
UPDATE2:
Cancel previous update... other short does work fine. My bad.