Merging from another database
-
I have a database with a few hundred devotions that I would like to start using on my WordPress page. I am hoping not to have to copy and paste each of them into my WordPress page. Is there a way to somehow merge the two? Thank you very much!
-
Can you just place the zip on your site temporarily (then post a link), i’m hesitant about posting email addresses in public and busy forums.
Great, here it is:
mzbc.com/theme_files.zipThanks,
Ok, all done…
One thing that seemed quite evident as a problem was a closing DIV element after the footer include ( .. get_footer() .. )…
This would mean
</div>
is being placed after the closing</body>
and</html>
(which is invalid)…I’ve cleaned up the files, removing the un-necessary extra lines and correctly formatted the code (or at least how i’d do it anyway)..
Your theme files make reference to 3 different themes for some reason, and i’d like to ask why this is?..
Firstly here…
<link rel="stylesheet" href="wp-content/themes/renoville/style_.css" type="text/css" media="screen" />
then here…
<?php $imagespath = "wp-content/themes/Theme5/images/";?>
then here…
<?php $imagespath = "wp-content/themes/Theme3/images/";?>
Anyway, here’s the files updated for you… (backup first if in doubt). If you get any errors or issues, post back and let me know..
index.php
https://wordpress.pastebin.com/m33d555aheader.php
https://wordpress.pastebin.com/m740e5b65footer.php
https://wordpress.pastebin.com/m3ac5ed3eLet me know how it goes… ??
That is a great question about the different themes. ?? It should be be Theme5. I guess that is what I get for using the original theme name rather than using my own…I must have mis-typed it sometime. I have no idea how the first one got there though.
Thanks again for putting so much time into this. I still have the backup files on the server that I posted before. I change all of the files, and the formatting is a little messed up as you can see…
https://www.straightpaths.mzbc.comIt is still not pulling from the database. Is there something that I need to do to make that happen?
Change this part in the devotions code..
else { if(function_exists('wp_die')) { wp_die('Failed to find a matching devotion.'); } else { die('Failed to find a matching devotion.'); } }
for…
else { if(function_exists('wp_die')) { wp_die('The result was empty for query <pre>'.$devQuery.'</pre>'); } else { die('The result was empty for query <pre>'.$devQuery.'</pre>'); } }
That way you get a print out of the query that’s not getting a result, and you can post it back here for examination.
As i said before, i tested the code on my test site without a problem..
RE: Formatting that’s something you’ll have to work on. I only rearranged the code to make it valid, so there is a chance some formatting will get messed up…
It may be advisable to just have a test site and use the default theme (while testing), then once everything works move it over onto your theme etc…
I still have the devotions code, it still works…
Ideally we should try and keep the formatting issue as a seperate issue, which is theme related markup, and just confuses the subject. Let’s just stick to one thing at a time, let’s get the devotions working as they should (i thought we were there already, lol, sigh*) then focus on the eye candy afterward… ??
Ooooooooook well…I figured out that part of my problem is that I need to update my database. We are constantly updating the devotions in another database, but I hadn’t updated the WP database. So I updated it now, so I think it may work. Since the formatting went weird after I changed the index.php file, I decided to try to go back to the original index.php file. Unfortunately, I changed the wrong file. I changed the main index file, which I think just tells the page to look for the theme and use it’s index. I assume that file is the same for all WP installations, but I do not have it backed up anywhere. So is there a good way to find that file so that I can test it again?
Sorry for all of the stupidity!
Thanks,
Just download the version of wordpress you were using and extract the file you need…. i’d imagine it comes in a .zip or .rar … been a while since i’ve had to download it.
Thanks. Ok, the devotions are now being pulled in correctly, but I am unable to read them due to color and formatting issues.
Does this look fine on yours?
https://mzbc.com/straightpaths/?page_id=9
If you go to https://www.straightpaths.mzbc.com, the formatting looks decent (a little off), but it does not pull the devotions correctly. If you click the Straight Paths Devotions link at the top though, it takes you to the page that pulls the devotions in.
Thanks
There’s invalid markup in the page still.
ClickyAnd looks like you missed the closing
</html>
in the footer.php …One problem is this line in the header.php (admittedly i missed this).
This line….
<li><?php wp_list_pages('sort_column=menu_order&depth=1&title_li=');?></li>
Should be….
<?php wp_list_pages('sort_column=menu_order&depth=1&title_li=');?>
Again header.php (i must have been tired, lol)…
<input type="image" src="<?php echo $imagespath?>/gobutton.jpg" border="0" value="Go"></div>
Should be..
<input type="image" src="<?php echo $imagespath?>/gobutton.jpg" border="0" value="Go" />
Start there and see where we get… ??
Thank you very much! I fixed the problems above. There is still 1 error in the validation page, but I am not sure what it doesn’t like exactly.
Error Line 38, Column 84: Attribute “border” exists, but can not be used for this element.
…/Theme5/images/gobutton.jpg” border=”0″ value=”Go” />
The problem is the with the *border=”0″* which looks okay to me! ??
Question…if the main page and this page we are working with are using the same template, then why is it only messed up on the devotions page?
Just drop the
border="0"
bit, it’s because it’s an INPUT element, i don’t think border is valid for INPUT (can’t believe i missed that).If need be, you can always add it to the stylesheet..
Like so..
input {border:none}
or..
input[type="image"] {border:none}
or any other number of ways…RE: formatting:
Not quite sure yet, trying to narrow that down… ??Well, I figured out why the formatting looked weird to me on the main page..the banner disappeared! ?? No wonder it looked strange.
HTML can be a nightmare to begin with…. it’s taken me years of practice to get where i am… and there’s still lots i don’t know… ??
Keep me updated and let me know if you require further help..
I’ll say this though, stick with it and don’t try to do too much at once, just work at it, remain patient and test as you go… ??
It’ll all be worth it in the end… ??
Thank you! I got the banner back. The main page (www.straightpaths.mzbc.com) looks how I want it to, but the second page (https://mzbc.com/straightpaths/?page_id=9) is getting the devotions correctly. So can I paste this https://wordpress.pastebin.com/m66276c9b somewhere into the main index.php? This is the main index template code: https://wordpress.pastebin.com/m4de8d3fc.
Thanks!
You already have this code.
https://wordpress.pastebin.com/m66276c9b
here…
https://mzbc.com/straightpaths/?page_id=9You don’t need to touch the index file, leave that be..
Add this to style.css …
.devotion {background:#fff;padding:10px}
Then look at …
https://mzbc.com/straightpaths/?page_id=9Better?
- The topic ‘Merging from another database’ is closed to new replies.