I just created a BLOG Script. I'm using foreach to loop and display the posts. But now I want to create a template engine like Wordpress. How can I do that? I'm new to PHP. I don't have any idea to do this.
I tried using file_get_content. For example:
file_get_contents("template_dir/template_name/index.php");
But there is a problem with CSS and images. That's my first problem. Anyone please help me to create this.
To bring in files you use include() or require()
However, I don't see why so many people insist on trying to reinvent the wheel. If you are building a blog install Wordpress and code your own Wordpress theme. Wordpress has been in development for years and is now not only one of the best blogging engines, but a very powerful cms capable of powering any type of site.
Related
Hello guys! first of all, I`m a noob in programming, have been learning
about 2 months+ now.
I`m currently half way coding a news / blogging website (e.g Mashable) using HTML, CSS, Javascript, Php (coding it from scratch to learn).
But Im kinda confuse now,
as far as I know, If I`m not going to use any type of CMS (e.g Wordpess). I will have to use a FTP software like FileZila.
If I need to update the website every hour, is it better to create it under Wordpress or Drupal?
If Im going to use FTP to update, wouldn`t it be time consuming to create a new html file and insert all the necessary tags again and again every time u need to post a news? How do people usually do it?
Sorry for the really noob question. Will appreciate any answers and advice on this, thank you!!
The fastest way is to use a CMS - it could be any CMS like WordPress or Drupal or some other.
You will need to upload the files via FTP every now & then, which although manageable, is cumbersome. Using a CMS would give you the opportunity to scale your news website in future to do numerous things, for example set featured news items, or allow different people to contribute articles & so on.
So to answer your 2 questions:
If your files are going to be changed frequently, it's better to use a CMS.
It will be time consuming to create new files & add the necessary tags, etc in it every time.
Having said that, the uses of a CMS span much beyond the above 2.
I'm moving a site over that is currently setup in wordpress. I've not got a great knowledge on how WP works but the database all makes sense to me. I've built a custom blogging engine for the new site but I need to transfer all the old posts into the new site.
Before I go writing a script to loop through each posts then grab the image url etc and then match that up to the columns in my own database is there anything that exists already? I can't imagine I'm the first to do this!
Also - am I right in thinking that the image(s) for the post are _wp_attached_file with the corresponding post_id in the wp_postmeta table?
I've tagged this with php for Wordpress but happy for scripts in Python or RoR too if they exist.
Thanks
Is the standard wordpress export not detailed enough? I find this a very handy tool: http://en.support.wordpress.com/export
There is a plugin that imports your posts into a CSV file. It would be simpler to write a parser for that, I think - instead of writing a script to query the WP DB
I'd like to use exactly the same slideshow script like http://drupal.org/project/views_slideshow but without using Drupal itself. Do you think it is possible? Perhaps the script is based on other OpenSource project I don't know?
There are a couple of Javascript Slideshow plugins. Drupal's Views Slideshow module uses jQuery Cycle plugin. http://jquery.malsup.com/cycle/
There are plenty of script that allow you to do some slideshow.
There are a lot of page that list lots of them.
Isn't here something that is what you are looking for ?
I'm trying to write a script that will show the rss version of a single url (title, author, image, source, etc..). This should behave much the way that facebook does when you copy paste a link to share and it generates this information automatically. I'm trying to do this with a php script but would also be open to opensource programs that can do this as well.
also, if anyone knows of any Joomla/Drupal plugins that can do this that would be great. This may eventually end up on a site run on one of these frameworks.
thanks!!
I'm not really sure what you're asking for, but here is a list of Joomla extensions that handle RSS syndication:
link text
This seems like a pretty specific application to get started with a big framework. Anyway, some Drupal modules worth checking out:
http://drupal.org/project/facebook_link
http://drupal.org/project/views
http://drupal.org/project/views_rss
Say you have a WordPress theme you like, but want to make use of a bunch of Django code that's already written. Is there a good and easy, and performant way, of sucking in HTML that is output from Django and displaying it inline in a WordPress posting, or page without using browser frames? Any good examples of this?
You can do this by outputting the content in Django as usuall and then making a Wordpress plugin with code for downloading it from Django's URL
readfile("http://yourdomain/your/django/view")
But it's a really bad idea. If you just want to use the wordpress theme port it to Django. This strange PHP/Python hybrid will be a nightmare to maintain, especially if at any point you decide to add more features or make it more dynamic.
if the djanjo-code generates a rss-feed, you could use a plugin like wp-o-matic to import posts from your django website into wordpress.