• Resolved jordan8201

    (@jordan8201)


    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!

Viewing 15 replies - 16 through 30 (of 97 total)
  • Ok, so to just finally clear this up, you don’t need anything other then a simple script you can place in a page that’s displayed in WordPress that will grab the matching entry for a given day…

    Basically a WordPress page that mimics the non-wordpress one posted above..

    Ok i’ve knocked a page template you can use, it will have the desired effect, but i’ll need to run through the process of how to set it up.. (don’t worry it’s easy)…

    You’ll need to accompany the page with some CSS to style the elements, but i can help you with that…

    If you could just let me know regarding my last post, we can move along and get it up and running… (i’m not going to write a full run-down on what to do, until i’m sure we’re clear on what it is we’re doing.. lol).

    Here’s the code thus far, and you’ll see, very easy to read, nicely formatted and it works… ??

    https://wordpress.pastebin.com/m4aa17b14

    If that’s what you’re after, then i’ll follow up with instructions on what to do next..

    Thread Starter jordan8201

    (@jordan8201)

    Well I actually have a page designed already that I want to use from a template. The url is https://www.straightpaths.mzbc.com.

    I want to be able to have the devotions automatically brought into this site. I guess maybe I could have just pasted the info from my other page into this one? I wasn’t sure if that was doable with WP. Maybe I am making all of this way too difficult. Anyway let me know if this is still unclear. Thanks! ??

    I’m not quite sure what you mean by automatically brought in.

    Your previous link here.
    https://mzbc.com/devotions/

    And the code i posted here.
    https://wordpress.pastebin.com/m4aa17b14

    Will both grab a devotion from the database, based on the day, in other words dynamically, and that’s what you seem to be asking for, unless i’m missing the point…

    Try it and see…

    Create a file named devotions.php , and place it in your theme folder..

    Example:
    /wp-content/themes/default/

    Copy the code i posted above (use the bottom section of the page to avoid getting the line numbers etc..) , save the file.

    Now goto in the WordPress admin and click on pages “Add New” , give the page a title “Devotions” slug “devotions” , leave the content empty.

    ADDTIONAL NOTE:: Select the devotions page template from the right-hand select menu before saving..

    Now load up your page… you’ll have a devotions page that selects a devotion from your wp_devotions table based on the day… as it did on the old page…

    It will make more sense once you do it i’m sure..

    Thread Starter jordan8201

    (@jordan8201)

    Okay, I did that. I think maybe I missed a step somewhere. I uploaded the file into the theme directory that I am using, instead of the default, which I assume I should have done. You will see the link is now there, but the background is not white as it should be. I chose the devotions template, but I left the html section blank.

    https://www.straightpaths.mzbc.com

    THanks a bunch!

    Looks like it’s due to invalid code in your header…

    Namingly this bit firstly…

    <div id="search01">
            <form method="get" id="searchform" action="https://mzbc.com/straightpaths">
    
              <label>
                <input type="text" class="text_field" value="Search" name="s" id="s" />
              </label>
    
     <input type="image" src="wp-content/themes/Theme5/images//gobutton.jpg" border="0" value="Go"></div>
    
            </form>

    Taken straight from “View Source”….

    If you can copy and paste the code from your theme’s header.php in a pastebin i’ll look over it and fix it for you.. ??

    Thread Starter jordan8201

    (@jordan8201)

    Thanks. Here it is:
    https://wordpress.pastebin.com/dbf709d

    It looks fine though with my other pages, so I am not sure why an error in the heading would affect this page.

    I imagine it should look like this, but i can only guess at best…

    https://wordpress.pastebin.com/d5689670d

    Since i’m essentially looking at one half of a layout.. but it looks right, aside from some extra elements that can be proberly be dropped from the code, such as this bit..

    <div id="mainhead"></div>

    Thread Starter jordan8201

    (@jordan8201)

    I don’t understand. This is what it should look like:

    https://straightpaths.mzbc.com/

    I just needs to have the devotions brought in daily.
    I thought I sent that link earlier. If I did not, I apologize.

    The link above is for your header.php, to fix the invalid code…

    The problem you have with the devotions is due to the invalid code…

    It’s still up and running perfectly on my local test installation…

    Font-size, colors etc, we can fix later, but that’s not going to help while your page contains invalid markup……

    This is why you are missing the white background…

    If you’re still stuck when i come to check back on the thread just zip up your theme and post a link, i’ll do it for you… (just this once..) .. ??

    Thread Starter jordan8201

    (@jordan8201)

    I am really sorry, but I think I let your pasted text expire. I was on the road all weekend and wasn’t able to work on it. Is there any way I can find it again?

    Sorry about that!

    As has your link to the pastebin…

    I’ll take a look again if you’d like to plonk the code into a pastebin again.

    Might be an idea to put both the header and footer (.php) code into one , or two seperate pastebin(s), just so i can see how many elements should and shouldn’t be there…

    Perhaps we should both choose “A month” when doing our pastebins this time… ??

    Thread Starter jordan8201

    (@jordan8201)

    Okay, I pasted what I think you need. Just let me know if this is not exactly what you want. It should be there for a month! ?? Thanks again for your help. I will start being more prompt in my replies now.

    https://wordpress.pastebin.com/m1b86524b

    Not sure what file the code is from, i’d hazard a guess at the theme index.php

    I think it would just be easier to zip up the theme…

    Or just these files (index.php, footer.php, header.php).

    It’s hard to know what elements exist when i have 1 piece of the puzzle so to speak.

    You could always give it a shot… by running your webpage through this and fixing the errors shown…
    https://validator.w3.org/

    Thread Starter jordan8201

    (@jordan8201)

    I would be happy to zip it up. What is your email address? Or should I somehow upload it? I ran the validator, but the index.php it was giving me errors from seemed to be a different index.php than I was seeing in my WP editor.

Viewing 15 replies - 16 through 30 (of 97 total)
  • The topic ‘Merging from another database’ is closed to new replies.