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!
-
I did…that fixed the background color, thanks. I actually want the devotions to be on my main page though, that’s why I was asking about putting the code into the index.php. The background color is fixed, but there are still some formatting issues. The index file is formatted correctly, but the other is not. So I would like to get the code that pulls into the devotions into the page onto the index.
Hope I am being clear.Thanks,
Ah ok, i wish you had made this clear to begin with (or maybe i overlooked something) as it may require a different approach.
Not on the laptop (where my test stuff is), so i’ll have to get back to you.
Essentially we can do it, no problem, but i’ll want to test before i go saying plonk this here, plonk this there.
Thinking about it though, i think the easiest approach would be to wrap it inside a function, you can place a call to that function wherever you like with 1 line of code…
Again let me get back to you, i’ll need to just run a few tests on the local install…. ??
Sorry about that. I probably didn’t make it clear. There may be other pages that will branch off of this eventually, but this will be the primary purpose of the site.
I don’t know why i didn’t think of this before.
WordPress allows you to use an existing page as the main page, it’s under..
Admin > Settings > Reading
The Devotions page we created earlier will be available to select as the main page (front page).
Select and save, and you should have the behaviour you want… ??
So, to be clear, this is just one option change in addition to what we’ve created already…..
If that’s still not what you’re after please elaborate!.. ??
Thanks, that would be a lot easier! One last problem…last time I logged into the admin, everything was fine…today I get this message:
Warning: Cannot modify header information – headers already sent by (output started at /home/mzbcco5/public_html/straightpaths/wp-content/plugins/wordpress-blog-stat/stat.php:37) in /home/mzbcco5/public_html/straightpaths/wp-includes/pluggable.php on line 865
Should I make a new post in the forum for this? I don’t think I added anything new, so I am not sure what the problem is. This is line 865:
header(“Location: $location”);
Thanks!
Well there’s your clue right there.
wp-content/plugins/wordpress-blog-stat/stat.php:37
The pluggable.php will chuck up such an error when a problem plugin is present, ignore the second part, it’s related to the plugin mentioned in the first part of the message…
Interesting. I went in and deleted the wordpress-blog-stat folder from the plugins folder and all is good. I am not sure what happened with that, but thank you!
I made the change you suggested in the admin. It worked when I set it to “static page”. The only problem is that for some reason it still does not look right. The main page looks perfect:
https://straightpaths.mzbc.com/devotions.php
The one that is working (pulling the devotions), does not look so good:
https://mzbc.com/straightpaths/?page_id=9I could start experimenting with trying to make the 2nd page lok like the first, but I don’t want to mess any of your work up that you did on the 2nd page. What do you suggest?
THanksFirst link you’ve given doesn’t point to an existing page (404 not found)..
Second link is the page created earlier…
What exactly do you want to change? Padding? Font size? Colour? Font type?
If you can give specifics it’ll only take 2 minutes to whip up a few lines of CSS..
Hmmm….how did that happen? ??
Ok, this is the correctly formatted page:
https://straightpaths.mzbc.com/This is the other:
https://mzbc.com/straightpaths/?page_id=9You will be able to see the differences.
First, the graphics are all missing. This may be what is causing much of the formatting problems. There is something odd going on with the search button on the top as well.Thanks!
Ok we need to go back and make a few changes in the devotions.php file created earlier…
The reason some formatting doesn’t match up is due to the CSS classes and ids (as in bits like id=”” and class=””) i used do not match up for your theme…
Lets start with Line 28 in the devotions.php file.
<div id="content">
Update that line so it reads.
<div id="mid">
I’ll post back with some more updates/changes shortly…
Ok, forget the last post, please update your devotions.php to the following…
https://wordpress.pastebin.com/m2af51ba6Will likely need further tweaking, but let’s start with that and work at it… ??
Much better! You are amazing! ?? Almost there I think.
Change this line.
$today = date("F d, Y");
..for…$devMonth = date("m"); $devDayYear = date("d/Y"); $today = '<p>'.$devMonth.'</p>'.$devDayYear;
That should fix the date… ??
I’ll post back with some more changes once i’m back at the other PC..
I did this, and nothing seems to have changed. This is what I did:
unset($post); $devMonth = date("m"); $devDayYear = date("d/Y"); $today = '<p>'.$devMonth.'</p>'.$devDayYear; /* $today = date("F d, Y"); */ $mYear = date("Y"); $mLeep = date("L"); $mDOY = date("z"); $r = fmod($mYear, 2); if ($r == 0) $n = $mDOY + 1; else $n = $mDOY + 366;
Is that correct?
Also change this..
Devotion for <?php echo $today ?>
For just..
<?php echo $today ?>
So just removing this bit basically..
Devotion for
The date should then appear as(or close) to what it is on the existing old page..
That’s all i was doing there, fixing the date to look like it does on the other page..
Is there anything you want to change? .. or are you just aiming to mimic the old page?
- The topic ‘Merging from another database’ is closed to new replies.