Rafael_Magnvs
Forum Replies Created
-
Forum: Hacks
In reply to: Multiple WP sites from same DATA TABLES (not just DB)Thanks bcworkz, for the input.
As I said on the post above yours, I do not claim this solution to be sustainable. It was an alternative that I found from an older post and tried on a current version. I also said that I don’t know if this alternatives have any downsides yet.I just believe people looking for something similar will be tech savvy enough to make a judgement call on whether or not to use the lazy approach described above…
Forum: Hacks
In reply to: Multiple WP sites from same DATA TABLES (not just DB)This is a “solution” is for different WP installs in different sub-domains stored in the same database.
But keep in mind that I have just found this alternative and I cannot tell for sure if these hacks have any downsides.
I will continue with the tests, if I find anything that causes problems I’ll post it here.
Forum: Hacks
In reply to: Multiple WP sites from same DATA TABLES (not just DB)I think I found the solution I was looking for.
After some digging around, I came across Support Thread from 3 years ago. You can click here to see that thread.I am currently using the 3.5.1 WordPress version. Anyways, I went to wp-includes/wp-db.php and did the following (as suggested in the post):
1. On line 683, I found
foreach ( $this->tables( 'global' ) as $table => $prefixed_table ) $this->$table = $prefixed_table;
2. Below $this->$table = $prefixed_table; I added the table I wanted to share. (Below you have an example with alternatives to all possible default tables – you can pick and choose which ones to use):
foreach ( $this->tables( 'global' ) as $table => $prefixed_table ) $this->$table = $prefixed_table; $this->options = 'YOUR_PREFIX' . 'options'; $this->posts = 'wp_' . 'posts'; $this->categories = 'wp_' . 'categories'; $this->links = 'wp2_' . 'links'; $this->postmeta = 'wp_' . 'postmeta'; $this->terms = 'wp_' . 'terms'; $this->term_taxonomy = 'wp_' . 'term_taxonomy'; $this->term_relationships = 'wp_' . 'term_relationships';
Forum: Hacks
In reply to: Multiple WP sites from same DATA TABLES (not just DB)Hey bcworkz, thanks for the input, once again..
Let me try to explain my situation better, to see if it makes any difference.
1. I have mywebsite.com, a.mywebsite.com and b.mywebsite.com
2. The all already share the same database. (different tables, except of wp_user and wp_usermeta)
3. I intend to write information (posts, pages) on the main domain only.
4. I want the a and b sub-domains to display the same information. The theme is essentially the same. It will only show the information in different formats. I do not need or want sub-domains to have writing capabilities per say. (so, if it’s an option, I would be satisfied with the sub-domains having only reading permissions.
5. I would like to do something similar to what I did when I shared the user database across the websites. How come it’s not possible to define on the config.php file the tables the Installation uses for its posts? And why would that be so bad?
What do you think?
Thanks in advance!Forum: Hacks
In reply to: Multiple WP sites from same DATA TABLES (not just DB)What about this alternative?
If the URLs are the only difference between the installs I could edit
the config.php(1) files and add:define('WP_HOME','https://A.mysite.com'); define('WP_SITEURL','https://A.mysite.com');
on the config.php(2) add:
define('WP_HOME','https://B.mysite.com'); define('WP_SITEURL','https://B.mysite.com');
Both installs will use the same database info only the URLs being different. If I define as described above, it should prevent the WP install from writing in the database because update_option is not used in the process.
Does that make sense? or my understanding of WordPress is incorrect?
Forum: Hacks
In reply to: Multiple WP sites from same DATA TABLES (not just DB)is it totally impossible or not simply achieved?
Forum: Hacks
In reply to: Search only using drop down menusThanks bcworkz, for taking the time to respond.
I will try to do what you have described above, since I am no expert, it will take some time, but I’ll get there.Do you know of any good tutorials on the matter?
Thanks again
Hi Mikko,
I followed the steps in the user manual and I was able to achieve what I was looking for, as far as separating search results in specific categories.
However, I do not want to have the “Everything else” (the heading) portion, which is currently displaying the same results on the left. How do I go about removing that?
And finally, how would you recommend I excluded image results posts from the left hand side results?
That did the trick!
Thanks of the supportThis is solved!
Hi Mikko,
I have just found an issue, when I perform a search that gets no hits, I am getting error messages on top of the page:
Warning: array_keys() expects parameter 1 to be array, null given in /home/content/01/9753501/html/wp-content/themes/service/functions.php on line 177
and
Warning: sort() expects parameter 1 to be array, null given in /home/content/01/9753501/html/wp-content/themes/service/functions.php on line 178
Any thoughts?
Hey Mikko,
That was exactly what I was looking to do. You nailed it!
One last question about this… How can I show the categories as links?
Thank you for taking the time to go over this issue for me.
Forum: Hacks
In reply to: How to change URL after submitting the form successfully?This is solved!
Forum: Hacks
In reply to: How to change URL after submitting the form successfully?Hello Bc Workz,
Your solution was as simple as it was on the money.. I did just what you said and my code ended up like this:
wp_mail($emailTo, $subject, $body, $headers); $emailSent = true; wp_redirect( 'my-target-page-here', 301 ); exit;
Thanks you for your valuable insight.
All the best mate!
Forum: Hacks
In reply to: How to change URL after submitting the form successfully?Hey Mattyrob,
I have tried what you said, but if I do that I stop receiving the email messages (Which are just as important, if not more..)
If I change the URL, do I have to make any other changes to make sure the email is delivered?
This is solved!