Convert CSS3 to wordpress.

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
So I am quite comfortable with my bepsoke designs and will need to move to a more rapid development system and wordpress is the go to one here.

So now. How complex is it to convert current sites to wordpress sites. Ignore the content I just want to know the most efficient way to take the styling of my current sites and make them work on wordpress.

Hope that makes sense? If it does not, ask and I will elaborate more.
 

rward

Senior Member
Joined
Oct 26, 2007
Messages
865
If you've worked with Drupal or Joomla or any other CMS system before then it's basically the same.

You have a Wordpress page that makes db calls and displays information according to how you tell it.

If the static page structure (class names, etc) is identical to what you are telling wordpress to produce then your page should display identically.
 

Darko

Senior Member
Joined
Jul 9, 2008
Messages
627
So I am quite comfortable with my bepsoke designs and will need to move to a more rapid development system and wordpress is the go to one here.

So now. How complex is it to convert current sites to wordpress sites. Ignore the content I just want to know the most efficient way to take the styling of my current sites and make them work on wordpress.

Hope that makes sense? If it does not, ask and I will elaborate more.

As simple as adding wordpress hooks inside your html.

As complicated as adding wordpress hooks inside your html.
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
If you've worked with Drupal or Joomla or any other CMS system before then it's basically the same.

You have a Wordpress page that makes db calls and displays information according to how you tell it.

If the static page structure (class names, etc) is identical to what you are telling wordpress to produce then your page should display identically.

That is not the case. Wordpress is a mess in itself with a file structure and logic that seems uber k@k to me.

As simple as adding wordpress hooks inside your html.

As complicated as adding wordpress hooks inside your html.

Yea staring to see now so many different hooks and functions everywhere for the smallest thing.

I wonder if I should not just rather write my own CMS it seems a lot quicker than to adopt a pre existing site for wordpress or I should convert current sites to use bootstrap's core and then manipulate an existing theme like SAGE although I highly doubt bootstrap does things the wordpress way and I'll end up writing a fck silly amount of Walker classes for basic shiat. Also not a fan of bootstrap since you designing from the outside in due to the predefined grids etc.

Getting ahead of myself I will search for a lynda.com class on how wordpress's file structure works.
 

rward

Senior Member
Joined
Oct 26, 2007
Messages
865
That is not the case. Wordpress is a mess in itself with a file structure and logic that seems uber k@k to me.
I'm unsure which part of my reply you're responding to, but again, If the static page structure (class names, etc) is identical to what you are telling wordpress to produce then your page should display identically.

Yea staring to see now so many different hooks and functions everywhere for the smallest thing.

Which are awesome as you can easily customize a heck of a lot using them.

I wonder if I should not just rather write my own CMS it seems a lot quicker than to adopt a pre existing site
Probably not.

Getting ahead of myself I will search for a lynda.com class on how wordpress's file structure works.

The file structure is simple enough.
This image: https://codex.wordpress.org/images/thumb/1/18/Template_Hierarchy.png/750px-Template_Hierarchy.png
and this page: https://developer.wordpress.org/themes/basics/template-hierarchy/

Should be all you need.

Basically, if you're looking at a single blog post page then open that image and start on the left.
Find "Single page" and you now have 2 options linked off that, "Single Post Page" and "Static Page". Since it's a standard blog post we choose the "Single post page block" and from that there are 3 options "Attachment Post", "Custom Post" and "Blog Post".
Choose "Blog Post" as it's neither of the other 2. Now you have "single-post.php" This is the first file that wordpress will look to to use to display the blog post. If you have this file, it will be used, if not then carry on in the picture and the next line is "single.php". If you have this file in your theme directory it will be used else carry on and you end up at index.php.

For something like a listing of all posts in the "Sports" category you'd look at "Archive Page" (from the left) and then "Category Archive" and from here you can see it will first look for a "category-$slug.php file (slug is created when you create your category, in this case it would be 'sports', so wordpress will look for a 'category-sports.php' file. If it can't find that it will look for 'category-$id.php'. If sports category id is 5 then the file would be 'category-5.php' if it can't find that it will look for category.php and failing that - index.php.

How does this help?
Say you have a category sports, one weather and one science. You can control the layout for all three using 'category.php'. But now say you want to customise the sports category and add a sidebar then instead of having "if($sports_catgeory)" in category.php you create a category-sports.php file and have the sidebar in that.



What you may also be seeing is lots of includes of other files.
This is good as it uses DRY code, you'll often see many files referring to /partials/post-loop.php and in there will be the layout for a single post. This may get used by category.php, front-page.php, tag.php, but with a different query condition. It keeps everythign "neat".

Wordpress is pretty powerful once you get into it.
 

DA-LION-619

Honorary Master
Joined
Aug 22, 2009
Messages
13,777
That is not the case. Wordpress is a mess in itself with a file structure and logic that seems uber k@k to me.



Yea staring to see now so many different hooks and functions everywhere for the smallest thing.

I wonder if I should not just rather write my own CMS it seems a lot quicker than to adopt a pre existing site for wordpress or I should convert current sites to use bootstrap's core and then manipulate an existing theme like SAGE although I highly doubt bootstrap does things the wordpress way and I'll end up writing a fck silly amount of Walker classes for basic shiat. Also not a fan of bootstrap since you designing from the outside in due to the predefined grids etc.

Getting ahead of myself I will search for a lynda.com class on how wordpress's file structure works.

No, just no.
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
I'm unsure which part of my reply you're responding to, but again, If the static page structure (class names, etc) is identical to what you are telling wordpress to produce then your page should display identically.



Which are awesome as you can easily customize a heck of a lot using them.


Probably not.



The file structure is simple enough.
This image: https://codex.wordpress.org/images/thumb/1/18/Template_Hierarchy.png/750px-Template_Hierarchy.png
and this page: https://developer.wordpress.org/themes/basics/template-hierarchy/

Should be all you need.

Basically, if you're looking at a single blog post page then open that image and start on the left.
Find "Single page" and you now have 2 options linked off that, "Single Post Page" and "Static Page". Since it's a standard blog post we choose the "Single post page block" and from that there are 3 options "Attachment Post", "Custom Post" and "Blog Post".
Choose "Blog Post" as it's neither of the other 2. Now you have "single-post.php" This is the first file that wordpress will look to to use to display the blog post. If you have this file, it will be used, if not then carry on in the picture and the next line is "single.php". If you have this file in your theme directory it will be used else carry on and you end up at index.php.

For something like a listing of all posts in the "Sports" category you'd look at "Archive Page" (from the left) and then "Category Archive" and from here you can see it will first look for a "category-$slug.php file (slug is created when you create your category, in this case it would be 'sports', so wordpress will look for a 'category-sports.php' file. If it can't find that it will look for 'category-$id.php'. If sports category id is 5 then the file would be 'category-5.php' if it can't find that it will look for category.php and failing that - index.php.

How does this help?
Say you have a category sports, one weather and one science. You can control the layout for all three using 'category.php'. But now say you want to customise the sports category and add a sidebar then instead of having "if($sports_catgeory)" in category.php you create a category-sports.php file and have the sidebar in that.



What you may also be seeing is lots of includes of other files.
This is good as it uses DRY code, you'll often see many files referring to /partials/post-loop.php and in there will be the layout for a single post. This may get used by category.php, front-page.php, tag.php, but with a different query condition. It keeps everythign "neat".

Wordpress is pretty powerful once you get into it.

You sir are amazing. Thanks very much this is what I needed things makes a little more sense now. Is think I'll give WordPress some in depth attention now.

No, just no.

I've done it before very successfully I'm fact it's still my go to method using laravel if clients want to edit certain content.

how about using a static site generator?

Good idea, I've looked at jekyll before. Ruby on rails should compliment such a workflow I think.

Sure, why not. What could possibly go wrong?

Not much had gone wrong
 

Pixelbender

Senior Member
Joined
Jul 5, 2009
Messages
723
Instead of writing your own, use one where hundreds of top coders all over the world are working on securing the CMS, updating and patching it etc etc etc AND rather spend that time and studying that CMS and you'll be well away in a few months. While writing your own one will see you spending more and more time on patching, upgrading and managing the distros. Just my opinion.
 

flippakitten

Expert Member
Joined
Aug 5, 2015
Messages
2,486
I have the same Feeling, I hate Wordpress for anything other than a basic site / blog!
However in saying that, it's the best tool for the job and fast enough when using it for it's true intention.

If you're creating a full web app, it would be best to rather look into a Framework. I personally like Yii. It beats writing your own CMS and has CMS like content editing a bit of a bugger to learn though.

*edit:
If you're planning on creating some sort of shopping cart for your site rather user Wordpress for the CMS part then install Pretashop in a subfolder ie. shop
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
Instead of writing your own, use one where hundreds of top coders all over the world are working on securing the CMS, updating and patching it etc etc etc AND rather spend that time and studying that CMS and you'll be well away in a few months. While writing your own one will see you spending more and more time on patching, upgrading and managing the distros. Just my opinion.

Fully agree hence why I am now taking the time to just bite it and learn the wordpress way from a theme development aspect. I don't give a woot for wordpress it's k@k thought out in my opinion, but if I can become proficient in writing my themes specifically for wordpress then it will be a load of my back since deployment would be a breeze.

I have the same Feeling, I hate Wordpress for anything other than a basic site / blog!
However in saying that, it's the best tool for the job and fast enough when using it for it's true intention.

If you're creating a full web app, it would be best to rather look into a Framework. I personally like Yii. It beats writing your own CMS and has CMS like content editing a bit of a bugger to learn though.

*edit:
If you're planning on creating some sort of shopping cart for your site rather user Wordpress for the CMS part then install Pretashop in a subfolder ie. shop

My Framework of choice is Laraval, still a long way to go to master it, but I get around.

As for wordpress yea ag it's what the people understand so I can charge for my themes and then the peeps can do their own menial edit as they see fit heck with wordpress I can even fire up a sandbox for them in no effort.
 
Top