I need to rewrite some code on my client's website that I haven't made. The problem is that it runs on wordpress (w/ a customised theme I guess) that I've absolutely no experience with whatsoever.
Where do I find the source code made by that previous developer? I tried to find it in the "wp-admin" page but I failed :D ... where would you edit website's landing page?
Thanks ;)
Depending if the developer wrote a new theme or edited another theme, and if the lather, wether he did it the right way.
Check out the name of your current active theme and you should find it here:
/path/to/your/wordpress/installation/wp-content/themes
If he altered another theme, there should be another directory named "activeTheme-child". There any changes should be made so you can run updates on the main theme.
Related
Hello fellow developers,
I have an issue that I am running up against regarding WordPress and the current website I am working on.
I have been give a task to revamp a website, and to insert that website into WordPress. I have been working on a "custom theme" which I succeeded in luckily. The problem with that theme is, the theme shows the homepage of the website I have revamped, and when I wish to add another page to said WordPress installation. All it shows is a blank editor page.. (The same with the "view" and "edit") on the homepage of that website.
TL;DR
I want to use my custom theme to add another page to the wordpress website, problem is it shows a blank page. And the preview of a new page just shows the theme page (so the add page refuses to do anything).
Is there a good and efficient way to migrate my current HTML & CSS website to wordpress? If so how?
Thanks for the read, it's really hard to explain the situation
So the problem comes when you try to add a new page, within WordPress? Did you accidentally edit that function? Try reinstalling WordPress. Since your theme is ready, you will just need to copy it to the new installation.
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'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 using a theme on a wordpress site that has this url: href='http://fonts.googleapis.com/ (this makes the ssl pages insecure).
I need to change the above link globally to this url: href='//fonts.googleapis.com/ (this link makes the ssl pages secure).
This one link is on all the pages of my website including, the registration page and login page. The content at my website is insecure because of this link and a warning message is stated to visitors, that this website content is not secure and your information could get replaced or hacked.
I was able to change this link in one place in the child theme. Now that one page is secure. I viewed the source and found the insecure link that is coming from the template not the web pages. I used whynopadlock.com which showed me the insecure link. I sent message to support and no answer yet. How do I globally change this one link in wordpress theme? I'm using wordpress version 4.0 and the theme is Evolve Lite. I want to keep this theme if I can fix the problem. I'm a newbie and I know very little php.
I had the same problem when changing adding SSL encription, I had to:
grep -rnw '[WordPress PATH]' -e 'http://fonts.googleapis.com'
Finding:
[WordPress PATH]/wp-content/plugins/wp-frontpage-news/inc/wp-fpn- main.inc.php:274: $myFontsUrl = 'http://fonts.googleapis.com/css?' .
This helped me find the file I had to change.
King regards!
Looking at the theme it seems that the Google Fonts link is hard coded in two places.
Line 155 of options-framework.php which can be found at evolve/library/functions/options-framework.php
wp_enqueue_style('google-fonts', "http://fonts.googleapis.com/css?family=Oswald:r,b|Cabin:r,b,i");
And also line 98 of functions.php found at evolve/library/functions/functions.php
wp_enqueue_style('googlefont', "http://fonts.googleapis.com/css?family=".$font_face_all);
Try changing those over to https or just //fonts.~ as you mention and all should be fine. Bear in mind that if the theme updates it may switch these values back again as they are core theme files looking at the location of them.
Im running Wordpress 3.1 and its showing that there are comments (ie: 3 comments) but when you click into the single blog post they don't appear but the comment form appears.
Im not sure whether its a template issue or something's not correct in the functions.php.
I have the multi site function running for multiple blogs.
Anyone else having this problem and or have a solution?
It has to be template issue, make sure that you have comments.php file present in your theme directory. You may want to copy from default theme too. The functions.php has nothing to do with that though.