Enable Cors on WordPress - php

I have a site with WordPress using WooCommerce, that I want to make as api for my React app..
I have understand that I need to add some Code Lines at the server code (wp content).
But I didn't understand which is code in which file of the server??
I have seen a lot of functions that "I need to put in my Functions.php" but none of them take care of the problem..
Someone can help me?
what is the missing code?
where do I paste it?
What I do wrong?
The files

Related

Wordpress Dashboard Display error

I have a huge problem with my wordpress dashboard display. After I upgrade to wordpress 4.5 my dashboard gone crazy.... its seems like it is not displaying css correctly. Its really killing me cause I could not write any article ...which very bad for my website. My dashboard looks like:
This is what seems to be the problem:
I tried everything. First I thought that is might be chrome's problem. I deleted history/cache ...etc. Not working. Then I deleted chrome and reinstalled it. Not worked. Then I used firefox, opera,internet explorer ... not worked. I put one friend of mine to look... it seems also the same to him. Then, I deleted wordpress 4.5 core file (wp-admin, wp-include) from ftp and installed back wordpress 4.4.2 and it looks the same..... I'm really desperate. I sought help on wordpress official website.... nobody helped me.... its crucial for me to solve this problem I really live with site's help. I really don't have any idea to solve it. This is killing me :(.
I appreciate any help.....
Add below code in wp-config.php file of your WordPress.
define('CONCATENATE_SCRIPTS', false );
It should solve your problem, you can read more details on below link.
http://manovotny.com/fix-wordpress-admin-styles-not-loading/
jQuery is not defined errors usually indicate that jQuery hasn't been loaded at all, so then other scripts that depend on jQuery being present throw the error.
Where are you loading jQuery from? According to this issue someone had a problem where they were including jQuery from Google's CDN, and WordPress was trying to load a version of jQuery that wasn't present in Google's CDN.
A link to your site would be helpful - it's difficult to determine what all is going on from only that screenshot.
It also looks like your site isn't loading any of the CSS for the admin area. Have you doublechecked your WordPress address and Site Address options in the admin?
This might also be set in your wp-config.php file:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
If your WordPress Address (which is the same as WP_HOME) setting doesn't match the URL with which you're trying to access the WP admin area, then you'll see symptoms like your site is exhibiting, where CSS doesn't load properly and some javascript may be missing.
One more suggestion: try activating a different theme temporarily (such as Twenty Fifteen) and see if that fixes up the WP admin. You may have a conflict specific to your current theme package.
Take care of adding define( 'CONCATENATE_SCRIPTS', false ); at the top of declarations, after comments.

Finding and Editing HTML Elements in PHP

First off sorry for being a complete newb and if this is a something I shouldn't be bothering people with, but I am fairly new to PHP and I have been tasked by my employer to make a couple of changes to a website that seems to be written primarily in PHP.
The website is ems-uk.co.uk
I have been asked just to check the location on the maps that display on the pages but I can't for the life of me find the file to edit within the file manager. I can find exactly what I need to change when I "inspect element" in Chrome but cannot find anything even close in the index.php file and there appears to be no other files for separate pages.
Hope someone can direct me in the right area and sorry again if this is the wrong arena for a question like this.
A bit of inspection suggest this is an OpenCart powered CMS/ecom site with the Kuler Moment theme (skin 3). I'm not familiar with the OpenCart dashboard but you may be able to log in and configure the google maps module from there. Failing that I would look in the theme files for the location map section.
You're looking to it wrong. PHP is server sided, you're trying to edit things client side.
You will need access to the webserver and edit code there. If you're asking this I'm not sure if its good if you're editing pages on that website though.

eZ Publish Edit Header

My friend asked me if i could add a little piece of code to his website, his website is running on the eZ Publish platform which i have never actually used before.
I have spent the last few hours trying to figure out how to edit the header of the template for his website http://tenantstips.com/.
From the Admin/Design area i can see an option to add code to the footer of the page but not the header.
I have also tried finding the header file from within the FTP files and can't seem to see it.
If anyone is good with this platform and can help me add a little piece of code to the header of the above website that would appreciated thank you.
You'll have to edit the files to do that. You can try via the design section in admin (depending on filesystem perms) but the best option is to edit the files via ssh or ftp.

How do I install the Telarus GeoQuote Plugin to my WordPress site?

I have a plugin from Telarus called GeoQuote. It's a lead generation plugin for their agents, and I'm trying to help an agent get the plugin working on his WordPress site. I have all the php files and the css file in a separate folder.
My question is, how do I get it on the website now? I tried the WordPress plugin installer, but it didn't work.
I'm assuming I can upload the files to the hosting server with FTP and then use php code to call on the plugin in the widget area I created in WordPress. But I don't know what kind of code to use.
Can someone help walk me through this or at least point me in the right direction? Thanks for your help.

Cannot overwrite Wordpress file via FTP

I'm currently working on a wordpress website, of which I'm trying to overwrite content-extensions.php with a new version. On uploading this it appears to work, the file transfer is successful. However, there is no change in the browser even after refreshing and clearing the cache. I've also ensured that there are no plugin's caching within wordpress, and file permissions are what they should be within FileZilla.
Here's the odd bit.
If I go into theme editor, and locate content-extensions.php I can see the changes that I've made in the source code. For whatever reason they're just not appearing in the browser.
I'd be really grateful if someone could point me in the right direction for this one, as I haven't a pickle.
Many thanks.
Are you working with an extension or with a theme based function?
If it's an extension, remember to activate it, i often forget that, i upload code, see it in the extension manager but forget to activate it.
If it's in the theme, are you sure you are using the right theme and not the basic one?
I know this doesn't shed any light on why it's actually happening but I've had that before and just deleted the file and uploaded the new one rather than trying to overwrite it.

Categories