David Alcaraz
Forum Replies Created
-
Forum: Localhost Installs
In reply to: My localhost redirect to original site when loginhello, you must the same like if you move your wordpress to another location.
Look at this post:
https://wordpress.org/support/topic/rescuing-a-wordpress-site-with-db-and-files-on-new-server?replies=1Forum: Fixing WordPress
In reply to: rescuing a wordpress site with db and files on new serverHello,
You must change the domain name in database, you will have to change in _options var home and site url
After that you will have to change the url in all the posts content.
Then you will have to change the database username and password in your wp-config.php
It is possible that you will have some designs issues and somethings that won’t work, styles issues o etc, you will have to edit your theme and save again the settings, this it is because some themes save the domain serialized, and when you change the domain name wont’t work.
Best regardsForum: Fixing WordPress
In reply to: PHP Memory QuestionsHello,
Try this:
Edit you index.php wordpress file and this at first line:
ini_set(‘memory_limit’, ‘-1’);Regards
Forum: Fixing WordPress
In reply to: how to change the image of website image on facebook postHello, by the way, Facebook usually cache the url one you have added it, so maybe the plugin could seems it is not working, it will work with new pages you added.
Please if the plugin it is helping you and it works for you add a review.
Best regardsForum: Fixing WordPress
In reply to: how to change the image of website image on facebook postHello, you can use this plugin to solve your issue, it will take the image from the feature image, the title from post title and description from post content, it is not needed configuration only activate the plugin.
https://wordpress.org/plugins/simple-automatic-add-link-facebook/
Best regardsForum: Fixing WordPress
In reply to: How can I save data from my plugin to the database?Hello,
you don’t need a new database table to save your plugin data in wordpress,
What you need:
First:
user_meta it is a database table that saves data from user, so if you need to save some data in your plugin you can do something like this:
Imagine that I want to save hourses, oranges and apples for my user, then I create a class or array in my plugin to save this data, something like this:
class user_data{
public $hourses;
public $oranges;
public $apples;
public function __construct($oranges,$hourses,$apples){
$this->apples = apples;
$this->hourses = $hourses;
$this->oranges = $oranges;
}
}
When the user fills the form and say it has 3 horses, 2 apples and 7 oranges, and submit this information you will get this information in the $_POST.
Then in the server side when you get the post form, you will do:$oranges = $_POST[‘oranges’];
$apples = $_POST[‘apples’];
$hourses = $_POST[‘hourses’];$data = new user_data($oranges,$hourses,$apples);
//sample of user id
$user_id = 1;
you will have the current user id, then you will save the data for this user like:add_user_meta( $user_id, ‘_my_plugin_data’, serialize($data));
With this you will save your user information in user meta with the key _my_plugin_data
to get the data and restore it, you only need to do:
$saved_data = unserialize(get_user_metadata($user_id,’_my_plugin_data’));
In the $saved_data you will have an object of user_data then you can access this data like:
$oranges = $saved_data->oranges;
$apples = $saved_data->apples;
$hourses = $saved_data->hourses;This it is the right way to save the data for your users, you can do it using an array it will works, but to access the data will be different:
$oranges = $saved_data[‘oranges’];
$apples = $saved_data[‘apples’];
$hourses = $saved_data[‘hourses’];best regards
Forum: Fixing WordPress
In reply to: Alter front end search to include or ignore dashesIn php code in your plugin..
After the user adds in the search box eco-5 and click the button search
You will get this data in the server side, then you will take the data in php code, if you are using the get method, you will do:$term = $_GET[‘your_search_field_name’];
$newSearch = str_replace(‘-‘,”,$term) IN str_replace(‘-‘,”,$search_data);
and you will add the $newSearch to your query that will look into the database for the results.
regards
try to add this lines after RewriteEnginge On
RewriteCond %{HTTP_HOST} !www.yourdomainname$ [NC]
RewriteRule ^(.*)$ http://www.yourdomainname/$1 [L,R=301]Regards
Forum: Fixing WordPress
In reply to: Alter front end search to include or ignore dashesThen if you only need to remove the slashes it is more easy:
$newSearch = str_replace(‘-‘, ”, $term)
on $term it is your initial search like eco-5 or eco5
regards
Forum: Fixing WordPress
In reply to: how to change the image of website image on facebook postHello,
I have sent a free plugin that will solve your issue, this plugin will add the metadata that needs Facebook to show the feature image of your posts, title and description, it is not needed configuration, the only that needs it is activate the plugin.
The plugin name it is:
simple automatic show my image title description when share a post in Facebook
It will work with your products if you use a woocommerce.When the plugin it is approved by wordpress I can give you the link.
Regards
Forum: Fixing WordPress
In reply to: Alter front end search to include or ignore dashesHello,
You need to change your search query, the most easy way that it won’t work for all cases it is replace – to % in the term, the best way to do it, it is first replace the – for % and after that, separate all the chars from numbers, make a new string like:
$newTerm = $chars .’%’.$numbers;Changing this you will get the right results
Forum: Fixing WordPress
In reply to: Error while updating database settingsHello,
You have an error in your sql querythis it is wrong : FIELD(t3.menu_order,4,)
it must be FIELD(t3.menu_order,4)
or FIELD(t3.menu_order,4,0)
Regards
Forum: Fixing WordPress
In reply to: WordPress MySQL DatabaseHello,
You can find what database it is in use in your wp-config.php, in this file there is which database it is in use, you need to search:
define(‘DB_NAME’, ‘database_name_in_use’);
If the user you have configured it has access to all databases, you can change only the database name and you will get current installation, if your wordpress has all the themes and plugins needed.Regards
Forum: Networking WordPress
In reply to: Accidentally changed both URL and cannot login again…Hello,
You must change it again under mysql database, in the table options, you must change your domain name again
Regards
Forum: Fixing WordPress
In reply to: How can I save data from my plugin to the database?Hi,
You should save this data in usermeta, in this table you can save the information your plugin needs.
To access the data you will need to find the row using the metakey and user_idregards