what is the difference between parent theme and child theme - wordpress

A client asked me to redesign her web site, built several years ago in WP by another developer. Although I've never worked with WP before, I'm pretty comfortable with html, css, and php, and I more or less understand how WP stores content and dynamically builds pages. But I'm wondering how to approach these challenges:
My client's site has about 75 pages. There are about 25 that are static (i.e. the content changes infrequently if at all; things like "about us" and "faqs") and there are about 50 pages that are more "blog-like", except that instead of posts, the content contains directory-type info (e.g. 12 DJs in the area) or event-related info (e.g. upcoming shows at local theaters). Both of these categories contain many sub (and sometimes sub-sub) categories (e.g. medical services > pediatric > kid allergy specialists) and the content updates fairly frequently.
I understand the difference in WP between "pages" and "posts". But I need to find out the best way to structure the static content. Should I just set up a parent/child hierarchy of pages, changing the permalinks to something that makes sense? Or is it better / easier to just build the static pages outside WP and somehow link to them from the common navigation?
As a web designer, I want to "wow" my client with a great design. While there are loads of wonderful WP themes available, I really need to create something unique. But I'm wary of breaking something, so what's the best way to take an existing theme and just tweak it enough to make it look a little different?
Finally, other than mounting a massive "copy and paste" effort when the new site is built, is there a way to transfer content from the original site to the new one?

I would create a Child Theme (https://www.hostinger.com/tutorials/how-to-create-wordpress-child-theme). And just do your changes in this theme.
You can download the complete Website with a plugin like duplicator and install it local (xampp).
Is hard to give you the right way. There are so many ways a theme can look like. Different page builder plugins or Advanced Custom Fields.
Maybe the only thing you can do, is to update (Theme, Plugin)everything and lift the page. Especially if it is a purchased theme with any page builder. But don't change anything in the main theme. Create a child theme!

I understand the difference in WP between "pages" and "posts". But I
need to find out the best way to structure the static content. Should
I just set up a parent/child hierarchy of pages, changing the
permalinks to something that makes sense? Or is it better / easier to
just build the static pages outside WP and somehow link to them from
the common navigation?
It's not something like that. Consider the child theme as inherited (like a PHP class) from the parent theme. Imagine every .php file in a child theme is like overriding a function from parent class which is parent theme in this example.
For more information check the codex out or google "wordpress theme vs child theme" there are lots of articles explaining the difference.

Related

WordPress technical theme design

In a typical WordPress project I guess there are 3 parties. Party 1 is the graphic designer providing psd/pdf or html that party 2 (the developer) will create a theme from with probably some custom posts so party 3 (the client and content editor) can update the site without messing up the design and with no knowledge about HTML, JavaScript, Gimp or PHP.
This would tie the main theme of the site or it's specific pages in the php page(s) and if some minor design changes need to be made it needs to be done through editing php files.
I was thinking the following for a theme design:
(assuming a content only site without having complicated sales statistics and such)
Instead of "programming" the page.php to fit the graphic design and bring in specific (custom) posts and other data I would have the page.php bring in sub content. This so the graphic designer can create the page without having to program.
When images need to be provided then wordpress can pre scale/crop for different screen sizes.
The entire page should be created from the editor by the designer NOT the editor/client and not in page.php:
<html {{lang}}>
<title>{{title}}</title>
...
{{main-slider}}
JS and css are added through custom fields so they can be merged to one file.
Main slider post looks like this:
<div id="main-slider">{{main-slider-content}}</div>
JS and css can be provided to overrule page css or js and will be merged to one file.
And the main-slider-content is content that the editor can provide through a custom post provided by the programmer that will hold the editor's hand all the way and makes sure everything goes right.
Some of these fields can be set with custom fields values of the page (reverting to defaults if missing) some will be overwritten by the post (like language or title).
The type of sites that will be produced by this theme are used by small business owners who would like some web presence.
I have a couple of doubts about the design and hope someone with more experience with wordpress can shed some light on this.
When the editor/client edits a custom post like some slider content they cannot preview the item because that content is basically used on every page. Even if I find a way to list pages where the slider is used and show that one it won't show the new content until it's published. Previewing pages seems a bit complicated to implement.
It takes longer to generate the pages because content and sub content needs to be fetched from the database after parsing the content. I've tried to do this with DOMDocument before and used <div data-custom-content="main-slider"></div> but that is too slow so I'll try with regexp.
Because content isn't going to change that much I thought maybe APC cache the page after a first request and serve it from there. Delete the cache only when something is updated. On VPS the cache could be (probably would be) trashed when the site is inactive for a long time (which would be quite often). This means that requests take a long time to process when people try to view the pages.
Anyone with experience or helpful tips in this
[UPDATE]
I see that particular design and the html template will still have strong dependencies on each other. I am thinking now of trying out Twig. The benefit will be that re usable components are classes that can be added to the project and full content is controlled in the wordpress editor in a way that someone with no programming experience can still manage the content.
When data needed in the page is going to change a programmer is going to be needed though.
This is kind of what the Advanced Custom Fields Flexible Content system does, and the way you've styled your examples looks very like Smarty, a templating system that used to be very popular, and which is still used by a few systems like Prestashop.
In my experience, this removing the middleman kind of idea doesn't work. You either need a very extensive - and therefore bloated - initial theming system to flex to different projects, or you need a basic one which a developer will customise later - in which case the best you can achieve is moving the developer's role to a different phase of the project.
Overall, I think the best scope for this type of idea is for designers to learn a bit more code.

Wordpress webstie as booklet: thematic vs underscore vs?

I have never developed Wordpress website from scratch or from default template or from parent theme or from starter theme. I mean, I have maintained already created WP websites.
However, now I want to try to create WP from the beginning. I have mock up of website that is something liek booklet, this means, that it has many pages (about 40) and all pages differes with content - some has images, some has additional graphics, some has text etc. Website consists mainly of static pages with different layout.
What are your suggestions for newby... Previosly i have read much about underscore and thematic and I like both. Are tehre suitable for my purpsoes?
I always use undersores.me as a starter theme for the following reasons:
I don't have to dig trough the parent theme documentation for hooks and filters
It is not bloated with unnecessary functions
Download package is customized with your theme name and slug, meaning that functions have appropriate prefixes/names

Drupal Publishing

I'm new to web design. I basically just jumped into this learning as I went. People recommended CMS's like Joomla & Drupal and I installed them spent a few hours trying to figure them out and gave up. I then proceeded to just design my web site in a text editor b/c it was easier just to learn html, css, js, etc. Well now I've got somewhere between 20 & 30 webpages I need to get published to the web. I have three CMS's installed on my host server and I've sort of decided to use drupal. So I've got drupal open and the example drupal home page. I can not figure out how to just change that page to my html page I've already created.
I feel like this is such a stupid question but I have googled myself into carpal tunnel. Can someone point in the right direction?
You can do this very easily by using a PHP snippet in the article, blog entry or whatever. You need to activate the PHPfilter module, and to make sure that the content type you are working with accepts PHP code... and that you as a Drupal user is allowed to use PHP code.
Otherwise, its simple, put something like this in the body of the content:
<?php
print file_get_contents("/path/to/file.html");
?>
A CMS does not manage html pages, it manages content. In case of Drupal, content is nodes, blocks, users, ...
The next important thing in a CMS/Drupal is separation of content and design. With a CMS like Drupal, you create/use a so called theme, which is a template for your content that defines HTMl structures, CSS and so on. That is more or less the same for all pages of a website.
Once you have that, the advantage of a CMS kicks in. You can now create content, as much as you want (more or less) and it will all be displayed using that previously created/downloaded theme. Without having to write HTML/CSS for every new page. And you can change your design/structure in a single place, and every single page of your website will be affected at the same time.
As you can see, that is completely different from what you have done with static HTML files. Which also means, that there is no easy way to "import" it into Drupal. You basically have to re-create the complete site, this time with using Drupal, and then add your content to it. And you will have to learn Drupal while doing that.
So, when you are finished with your website as static pages, just upload them to a hoster and be done with it. And maybe start with a CMS from the beginning with the next project...

How to Build WP Site with Hierarchical Content and Using Custom Design?

A client asked me to redesign her web site, built several years ago in WP by another developer. Although I've never worked with WP before, I'm pretty comfortable with html, css, and php, and I more or less understand how WP stores content and dynamically builds pages. But I'm wondering how to approach these challenges:
My client's site has about 75 pages. There are about 25 that are static (i.e. the content changes infrequently if at all; things like "about us" and "faqs") and there are about 50 pages that are more "blog-like", except that instead of posts, the content contains directory-type info (e.g. 12 DJs in the area) or event-related info (e.g. upcoming shows at local theaters). Both of these categories contain many sub (and sometimes sub-sub) categories (e.g. medical services > pediatric > kid allergy specialists) and the content updates fairly frequently.
I understand the difference in WP between "pages" and "posts". But I need to find out the best way to structure the static content. Should I just set up a parent/child hierarchy of pages, changing the permalinks to something that makes sense? Or is it better / easier to just build the static pages outside WP and somehow link to them from the common navigation?
As a web designer, I want to "wow" my client with a great design. While there are loads of wonderful WP themes available, I really need to create something unique. But I'm wary of breaking something, so what's the best way to take an existing theme and just tweak it enough to make it look a little different?
Finally, other than mounting a massive "copy and paste" effort when the new site is built, is there a way to transfer content from the original site to the new one?
By reading your question, it seems to me that choosing WP for this kind of website was a bad choice.
Redesigning it, though, won't be that hard if it's using page templates for pages.
And yes, there's a import/export tool in WP to tranfer content. (see administration panel)
I, really, advise you to read this great tutorial about creating WP themes.
I've a blog-like WP site myself (contains RPG development articles). Here's what I did. Nested static pages simply have parent-child hierarchy: /about/mingos - that's easy to understand and i value this kind of content organisation (personal opinion).
As for themes, there's a no-brainer tool that, while not exactly apt for real business, has the capability of letting you see how stuff will look in seconds, and can sometimes give you great ideas. It's called Artisteer and there's a demo on its site that you can have a look at. Try your design ideas with it, see how stuff will look like. I'm sure you can come up with some great ideas for a "wow" design :).
Exporting content, as Soufiane Hassou remarked, is possible from within the admin panel.
Don't rule out using categories to create your hierarchy. That way you'd get the benefit of cross categorization of DJs and venues by location to create a robust cross reference system. Pages don't get this benefit without extra work.
To make this in to a directory, though, is gonna either be heavy work on managing the pages or heavy work on creating a solution that will cross reference everything and bring the content together in a usable way on the front end.

Can a WordPress site be made to be more than a blog?

I want to use WordPress for my personal website, but it isn't going to be structured like a blog. Can someone help me with a few concerns I have before I get too deep into it?
I want it to have a main page, and a hierarchy of content pages. Can I make the default page be a home page, and not a big chronological listing of posts?
I see that the DotNetNuke CMS has built-in support for auto generating your menus based on the pages you create. Does WordPress have anything like this?
Can I make the blog post section come up in a sub-directory like mysite.com/blogposts?
Is there anything about WordPress that makes it an obvious bad choice for a general purpose website? Does it have extensibility for thinks like shopping carts or whatever in case I want to add them in the future? I just want to make sure I am not doing something stupid by choosing a blogging software for a general purpose website with future requirements that aren't yet known.
Yes, current versions of Wordpress support designating a content page as the home page.
Yes, Wordpress will generate a set of nested lists that represent your content pages; it would be the job of the theme to style this into an appropriate menu (and most themes do not).
You can set up your permalink structure to do this, yes.
Wordpress is a good choice up to a point for many kinds of web sites, but if you want to integrate with a shopping cart or other complex application, I'd suggest looking at Drupal instead. Wordpress's developer ecosystem is mostly set up around extending its existing capabilities (blogging and content management) not on adding other unrelated functionality. Drupal is much more of a general-purpose framework for any kind of application or site.
I've set up Wordpress for several non-blog sites without issue.
Yes, you can create a static Page in Wordpress and set it as the default page. Read more about Wordpress Pages here: http://codex.wordpress.org/Pages
Yes, you can generate menus of Pages, both flat and hierarchal. Most themes will include a Page sidebar that will show Pages you have created. You can of course code and style your own to your liking. For example, this bit of php will pull out the top level Pages in your hierarchy and generate html for a series of <li> elements:
wp_list_pages('meta_key=page_title&depth=1&sort_column=menu_order');
Yes, you can have the blog section come up as a subdirectory.
Wordpress is a fine choice for a general purpose personal or even small business website. It only takes a little effort to convert your own custom layout into a Wordpress Theme, or you can choose from thousands of ready made Themes. You can do a lot with the base install, and its always being updated. Plugins and Widgets allow you to add all sorts of new functionality to Wordpress with ease. If all else fails, you can always write your additions own with a little effort.
That said, Wordpress is primarily blogging software. It has some decent CMS features, but its not the core focus. If you aren't going to do any actual blogging, Drupal is a solid option.
I'm not a heavy user of WordPress but my feeling for it is that it is primarily a blogging tool. It sounds like you want a full CMS. I'd have a look at Drupal (as PSU_Kardi suggests) or Joomla. Both have built-in support for or add-ons for blogs, e-Commerce, ...
2: Multi-level navigation plugin: http://pixopoint.com/multi-level-navigation/
4: Some e-commerce plugins: http://wordpress.org/extend/plugins/search.php?q=e-commerce
Yes, available by default, configurable via control panel
Yes, it's usually on by default on modern templates (unless you're using something extremely exotic)
Yes, you can do pretty much everything with permalinks
I really don't see a reason why wouldn't you choose wordpress... many plugins available for this platform can do almost everything - even more than standard cms solutions. There are SEO plugins, e-commerce plugins, security plugins, forum plugins, modern anti-spam protection, design enhancements, advanced templates with easy to use control panels...

Resources