SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I make my posts udate automatically

    Hi,

    I know this can be done, cause the blog hosting sites do it. I'm wondering if I can do it myself using HTML/CSS, or maybe JavaScript.

    On the blog hosting sites, when you make a new post your other posts are automatically updated to show the new post on each page, usually under "Recent Posts" or "Articles" or some such.

    How do I make this happen without using a blog hosting site like WordPress?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    It's usually done with quite a bit of PHP in blogging software. It would probably take a fair bit of PHP knowhow to replicate that behavior. You could do a simpler version of it with a simple 'PHP include'. Include a file at the end of each post that you update manually, just typing in a list of latest posts that would show at the end of each post.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I think that will work.

    Thanks

  4. #4
    SitePoint Addict
    Join Date
    May 2009
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've seen alot of free script online.. you might try search for it, i noticed alot results on that one..

  5. #5
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    It's usually done with quite a bit of PHP in blogging software. It would probably take a fair bit of PHP knowhow to replicate that behavior. You could do a simpler version of it with a simple 'PHP include'. Include a file at the end of each post that you update manually, just typing in a list of latest posts that would show at the end of each post.
    I like your article "Enhance Your Site With PHP Includes".

    I have my blog posts listed in the right column of a two column layout. I want them to update automatically with the current post always at the top of the list, and the remaining posts ordered by the date they were posted.

    Any tips on how to do this?

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Well, unless you are using some kind of CMS like WordPress (or one you make yourself), you have to do it manually.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  7. #7
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Well, unless you are using some kind of CMS like WordPress (or one you make yourself), you have to do it manually.
    WordPress' CMS does a decent enough job, the problem is they're too restrictive, and only allow you to edit your CSS.

    All want to do is start a blog, run a few adds on it, edit whatever I want to edit whenever I need/want to, and leave it at that.

    But anyway,

    Any tips or articles on how to create a simple CMS for a simple blog?

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by DocType View Post
    WordPress' CMS does a decent enough job, the problem is they're too restrictive, and only allow you to edit your CSS.
    Are your talking about wordpress.com? If you go to wordpress.org, you can download the CMS, and have access to every part of it, so you can change whatever you like--templates, structure, behavior, the lot. That would be much easier than building your own, which would take a long time to learn.

    A good book on learning such skills is Kevin Yank's book, Build your own Database Driven Website.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  9. #9
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Are your talking about wordpress.com? If you go to wordpress.org, you can download the CMS, and have access to every part of it, so you can change whatever you like--templates, structure, behavior, the lot. That would be much easier than building your own, which would take a long time to learn.
    I have a blog on wp.com.

    I now have a blog set up on WP.org, and yes I can access all the files for whatever theme I have active.

    Maybe it's just a learning curve, but to me it seems an extremely slower process hunting through the tons of code associated with wp themes.

    If only there were a way to start with a blank page and build on that.

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by DocType View Post
    Maybe it's just a learning curve, but to me it seems an extremely slower process hunting through the tons of code associated with wp themes.

    If only there were a way to start with a blank page and build on that.
    Yes, it can be slow, but it's not too hard to copy, say, the Classic theme, and create a new style sheet for it and move elements around the page. There are online tutorials about this. I did one a way back, which is probably getting out of date now (I've moved on from WordPress), but possibly worth a look. If you really want to start with a blank page and yet have all the functionality of a blog built in, you are better off going with a CMS like ExpressionEngine (costly) or a free alternative like MODx. In each case, there's a learning curve, of course, but not too steep.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  11. #11
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Yes, it can be slow, but it's not too hard to copy, say, the Classic theme, and create a new style sheet for it and move elements around the page. There are online tutorials about this. I did one a way back, which is probably getting out of date now (I've moved on from WordPress), but possibly worth a look. If you really want to start with a blank page and yet have all the functionality of a blog built in, you are better off going with a CMS like ExpressionEngine (costly) or a free alternative like MODx. In each case, there's a learning curve, of course, but not too steep.
    Slow is the problem, I'm used to working with notepad and a couple of browsers.

    Once I get the look of the blog right most of what I'll be doing is adding content, maybe an add or widget here or there, so it's not that big a deal.

    Thanks for tutor link.

  12. #12
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been reading your tutorial, and I've found the file; However, the header file is empty, there is no code in it.

    I can open the files individually in my browser, and copy them into wordpad, but I have no idea how to upload them back to my server, or how to duplicate the entire folder at once, as all I can do is open the separate files, but I can't copy the folder or from the folder directly.

    I'm doing this from my browser BTW.

  13. #13
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by DocType View Post
    I can open the files individually in my browser, and copy them into wordpad, but I have no idea how to upload them back to my server, or how to duplicate the entire folder at once, as all I can do is open the separate files, but I can't copy the folder or from the folder directly.
    You need to use an FTP program of some sort. You can't view php code in your browser, as it is processed on the server before being sent to the browser.

    The best way to work with WP is to save the files onto your computer, modify them there, and the upload to the server with an ftp program. A nice free one is FileZilla.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  14. #14
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suspected something along those lines; Do I need to have PHP on my system to run the theme locally?

  15. #15
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by DocType View Post
    Do I need to have PHP on my system to run the theme locally?
    Well, yes, although running them locally is not what I was referring to. I was just saying that you can edit them on your computer, and then upload them to the server. Then you can view the results online and don't have to worry about having PHP on your own computer. That's the way I tend to work.

    Of course, if you want to build and test the website on your own computer before uploading anything to the web, that's also easy to do. You can download a free testing environment and use that on your computer. There is XAMPP for Mac and PC, or WAMP for PC and MAMP for Mac. They make life very easy. I use MAMP.

    But in your case, I wouldn't complicate things like this. Just test the blog online as your build it.

    Sorry if that doesn't make sense. Feel free to ask questions.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  16. #16
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been editing the files in notepad and uploading them, which is fine since FileZilla does that pretty fast.

    The problem I'm having right now is sorting out how the WP themes are constructed. They us PHP to call sections of the page from non-intuitive places in the code, so it's difficult to position elements.

    I've already designed my blog My Way, and I've uploaded that, but WP tells me the theme is broken and needs a style and template files.

    The style is the style.css, I'm not sure what they're referring to as a template though.

  17. #17
    SitePoint Guru DocType's Avatar
    Join Date
    Feb 2005
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now I figured it out, I was using an internal style sheet, wordpress uses external style sheets.

    And that didn't work either.

    I give up.

  18. #18
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is not hard to do that.just choose a suitable theme include the Recent Posts category,nearly all the theme can include it.so don't worry.just keep update your post reguallly.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •