Member Offer
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wordpress' 'the loop' in context to adding blog features to static pages

Discussion in 'Website Design Forum:' started by bamme, May 2, 2011.

  1. bamme

    bamme Senior Member

    Hi, im reading up on how to simply add a "blog" page to a static site, which would list posts.

    I noticed on WP's documentation ( this:

    It is necessary to include The Loop in your pages to effectively take advantage of the multitude of Template Tags or plugins available. Familiarize yourself with The Loop and the basics of The Loop in Action to get underway with integrating the power of WordPress into your website.​
    I have tried to search this but i get lost in the tutorials, for example this:

    it looks great but i can't find anything specific to how id need to get to know the loop and what about it i need to understand/include in web pages for this specific purpose; simply add a "blog" page to a static site, and potentially category sidebar.

    i am conscious in future the blog will use plugins such as a facebook like button so i want to be able to know how to use the loop best in context to what im doing

    has anyone got any useful resource links??

    i realise i could just shove a blog in a subdirectory and just put a link from my site. however, alongside this, ive created a wordpress site here:

    my developer friend has added a booking system he made in the sense of placing it in the same directory. heres the login interface:

    kinda ugly. what i want to do is add bits and pieces from existing wordpress includes etc to make this look like the wordpress site. so really, i think i do need to know what this loop thing is all about to do this.

  2. richimgd

    richimgd Member

    Hi, I've only read the first sentence in your post about wanting to have a static wordpress site based on pages and having one of the pages as a blog section to display your posts. The rest of your post is quite technical when the solution to what you have asked is quite simple:

    In your admin page, go to settings > reading. Select what you want your Front page (basically your homepage) to be, then choose what you want for your Posts page, which in your case will be blog, if that's what you called the page.

    Thats it... Unless I have completely missed the point of your question...
  3. Kevin

    Kevin Senior Member


    Or, from what I can tell, your static site should just be built up by using static WP pages, and then you can just include the Loop on your blog page. Then all of it would be in the same directory.
  4. bamme

    bamme Senior Member

    this is a good shout and something i didnt think of.. im unsure as to whether this would work as im too unfamiliar with the php workings of that booking system, but what you're saying is that i should take the relevant code out of the existing login.php page which is static and not integrated via wp (, and create a new page, within my wordpress admin panel, and paste it in there in code view and save this as the login.php page, rather than try to insert my wordpress pages'/posts' header and footer etc in and around the login.php file?
  5. Levi

    Levi Moderator Staff Member

    can't help, but did notice you've changed your name :p
  6. Kevin

    Kevin Senior Member

    Something like that. You seem to be good at overcomplicating your sentences :rolleyes: :p
  7. bamme

    bamme Senior Member

    Thanks :)

    That is probably my most well-practiced, best and most unique skill. Its good for if you ever wanna wriggle out of anything.. you can talk so much people don't have a clue what you were trying to get out of in the first place

    It's not good for exams with word count, explaining yourself, trying to help anyone else when they have a problem, or getting help with your own.. heh
  8. richimgd

    richimgd Member

    You dont need to write or modify any php or even know what the loop is to do this.
  9. bamme

    bamme Senior Member

    Thanks for clarification richimgd and this is something i like the sound of. haha, can i ask in this case:

    can i just also clarify that you second Kevin's idea; just taking the relevant php code out of login.php, and all other booking.php files which provide the 'visuals', and placing them into new wordpress Pages created via my admin panel (pasting into code view of wysiwyg editor)
  10. bamme

    bamme Senior Member

    (to clarify, my task is basically to make that login system look like it's corresponding website's pages as much as possible. the websites pages are wordpress pages. to have a look around these login details have been set up: user, pass: cobblers - however if you do use those details and look around please dont book anything as its connected to my friend's gym's live database.)

    the site is here

    the login interface of the booking system (or how to get into it) is here
  11. richimgd

    richimgd Member

    I second kevins idea about building the site out of static pages and then using the blog page to display your post as this is what I originally said on my first reply. I kept it very simple as to do this is a very simple task and doesn't require using php or knowing what the loop is as it is all done via wordpress admin. Of course you can easily get technical by getting involved with the loop...

    I dont know what login.php is or booking.php... this is a different issue from your first question. I logged in but it gets a 404 error message as it cant find member_login.php which it is looking for inside the booking directory:
  12. bamme

    bamme Senior Member

    ah - sorry. this bit was unclear. i should have detached this part from the original question, both questions are here because i presumed they both related to the loop:

    this is the question im referring to, sorry, not the first one. if im right, i now am starting to think i dont need the loop at all for this question, as the loop is the thing used to do things like list posts.

    so my reply to kevins comment, which was this:

    also related to the second question, quoted above in this reply.
  13. richimgd

    richimgd Member

    So this booking system has been setup completely outside wordpress by your developer friend? So its not a wordpress plugin or anything?

    I am not a php guru and dont know how this booking system works, but what you could potentiolly do is add it into a theme template. Depending on what theme you use, when you create a page in wordpress can you choose a template to assign to it? I know you can in the default twentyten wordpress theme. Locate a template file eg onecolumn-page.php (this is in the twentyten theme - probably not the same if you use a different theme), then save as a new name eg bookingtemplate.php. Inside this file notice at the top of the file it says
    change this to something like
    It is inside this file that you need to add your booking system code and link to any other files it requires. It might be that you need to mainually add in your header instead of adding it dynamically as an include since you will probably need new things in your header such as booking system speciffic stylesheets or any other files the booking system needs linking to from the header.

    Once you have got this page sorted you can create a page called 'Booking' inside your wordpress admin, then choose the 'booking template' template you have just created. Then when uploaded your booking page will currently exist on much nicer!

    You will need to be confident with HTML and have a working knowledge of PHP to do this. If this sounds like too much work try and look for a booking system plugin as that might be easier to integrate with the site without getting involved with the code as much.
  14. bamme

    bamme Senior Member

    You know what i actually understand this, and it makes lots of sense, thank you very much :) my friend who made the booking system will probably be better at trying this than me as he understands php whilst i clearly dont. heh but ill look at the code and maybe even try on a test page as i have the 'stripped down' version of the login.php file to look at i guess.

    or maybe i will read this book i bought about developing for wordpress. heh.

    thanks people
  15. richimgd

    richimgd Member

    Yea have a go at it, just make sure you don't overwrite a template your already using for something else, duplicate it first and re-save it, then if it doesn't work at least you wont screw up other parts of the site ;-)
    If you're already working with someone who is a php developer he will probably be able to sort it out.
    Good luck!
  16. RGB

    RGB New Member

    Hi people, I'm bamme's php developer friend.
    Just thought of an infinitely simpler approach. Create a new page in the existing template which contains an iframe whose source is the login.php file. The rest of the booking system will then run in the iframe inside the theme.

    Member Login - Winning Health Solutions
  17. richimgd

    richimgd Member

    Fair enough that's a quick way of doing it.. didn't think of that. You will obviously loose browser back button functionality within the iframe this way but not sure if that is important. Are you putting the iframe inside the template or are you putting it in via the wordpress admin?
  18. RGB

    RGB New Member

    It's a bit of a cheat, I suppose, but it's an easy way round a lot of problems.

    The iFrame is in a new page created in Wordpress admin. This page becomes a frame for the whole booking system. Yes, you do lose back and forward browser button functionality, but I think that is acceptable (it happens in online banking etc.) I could always add back and forward buttons on the booking pages in addition to the existing navigation.
  19. bamme

    bamme Senior Member

    hi richard! haha im glad i didnt post the thread "any obvious problems with putting this in an iframe??" looks like you sorted it. i see no problems here either as we've no need to do anything with SEO for this, and we can provide a link for people who's browsers don't support, to the external standalone page. (just for closure/to spark further discussion here rather than leave it blank!)
  20. BlackPearl

    BlackPearl New Member

Share This Page