how to master wordpress theming? - php

I have recently finished up learning PHP/MySQL,css3,xhtml and Photoshop.And now i want to create themes for WordPress.So please suggest me some ideas...

I would start by downloading some of the popular themes, (such as cutline) and looking through the source.
It's essential to understand the loop, the template hierarchy, and the widget system.
Keep the template tags and function reference docs handy (there's a function for most things you could want to do).

I suggest you to read Digging into wordpress by Chris Coyer and Jeff Star.
It's a great guide for learning wordpress and it also provides a great section dedicated to wordpress theming.

Related

I have to learn Typo3 or Drupal and I don't know where to start

So we got a great project and we absolutely have to learn Typo3 or Drupal for it quickly. I already know some basic things.
I did the installation correctly for both, I know how to set up a basic Site using Fluid Template in Typo3 and I know how to set up a basic template in drupal without any styles.
My Problem now is how do I style a website since typo3 or drupal doesn't have a field for classes (The fields just get some random ids) and also how can I build a website with multiple sections where I have to style each section individually.
If you have any links to good tutorials or anything else that explains what I need to know I would appreciate it.
First of all, i think you understand HTML/CSS and know that TYPO3,... are content management systems. They're wrapping your content (saved to the database) with a template like HTML Files to send the result to the browser as a full rendered website.
ThomasLöffler already gave you the hint to read the documentation on both websites to make your choice which one you want to use. I prefer TYPO3, but the start many years ago wasn't easy. So i could you explain a little bit, and on a very short way what you need to do... After all please read the docs on typo3.org (Gettin started guide or something)
In TYPO3 you need to include and build your HTML Template. Prefered with the FLUID Template Engine / Framework. After that you need to set it with the TYPO3 TypoScript as your main template.
The content templates like will be rendered by the TYPO3 Extension "fluid_styled_content". This extension has also fluid templates to render the content object into a html output. Before you have enough knowledge about typo3 it's not recomended to change them.
The main thing is, that you need to include a stylesheet (css) file in your site. In TYPO3's TypoScript it's for example like this:
page.includeCSS.file100 = path/to/your/css/mystyle.css
Thats the very short overview and very little explanation what to do. But as Thomas said, you need to understand both and decide for one of them. And of course you need to read the docs first a little bit, before you ask. That would help you and each of us, to give you better answers. Good luck!
TYPO3 Gett started:
https://docs.typo3.org/typo3cms/GettingStartedTutorial/Introduction/Index.html
You can learn a lot of things if you take a look into the code of the official introduction package (https://extensions.typo3.org/extension/introduction/) The package can simply installed over the extension manager -> get preconfigured distributions
Or you just use it as a basis to build your own layout. You do not have to reinvent the wheel ;)

Social Sharing Buttons Not Working in custom WordPress theme

I have of late been developing a custom WordPress theme for my own blog from the ground up! Most is not finished but my social sharing buttons are not working at all!
I have been using this tutorial....
http://www.jqueryscript.net/social-media/jQuery-Plugin-To-Customize-Social-Share-Buttons-Counters-SocialShare.html
and gone over all of my code with a fine tooth comb! I even tested it on a testing page and it's working fine there so i have no idea why it's not working on the actual theme!
I got a feeling it has something to do with my functions.php page as none of my widgets work in my sidebar which i have overcome by adding the custom code there! So i probably have to add some more code to my functions!
Also just to let you know eack of the buttons and their counters are contained within a div I made just below the_content and above the comments_template on my single.php
I am also running WordPress Version 3.9.1 if that helps
Any help would be greatly appreciated!
Phillip Dews
Without any examples, fiddles or code samples, it is impossible to assist. Having had a fair bit of experience with WP, this will be very difficult to help you with, unless you can provide a live site to look at. Even then, may be challengin' :)
Looking at that page you linked, your problem is almost certainly php-based, not jQuery. If your functions don't work and you're adding php code directly to your sidebars, then yeah, absolutely php.
A couple of things I can think of though that are commonly problematic:
Check/test/debug your functions.php file by itself. Make SURE it's rock solid.
If you're developing heavily, setup XDEBUG. Invaluable!
If you're mostly themeing, check out the debugbar plugin.
Of course, you'll always want to make sure you're using the template hierarchy correctly (http://wphierarchy.com/). Double check every path you use, specifically the differences between paths to load stuff from themes -vs- child themes:
http://codex.wordpress.org/Child_Themes
http://codex.wordpress.org/Function_Reference/get_template_directory_uri
http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri).
Oh yeah: functions.php in child themes loads in addition to the parent's functions.php, it does not replace it.
Hopefully something in here helps.

Beginning to use wordpress, custom theme?

I'm pretty new to wordpress (only a couple of days), but I have it up and running on my website with the default theme. First of all I would like to change this theme. I have found a tutorial directly from wordpress but it is extremely vague: http://codex.wordpress.org/Theme_Development. I'd like to have a totally different layout for my website though, with only one page being replaced daily with a different article - a new article everyday basically. But I don't know where to start. I want to first create the theme though, I think that will put things in to perspective. How do I do so? I know the principles of php and enough about html and css to create whole websites. Thank you
That link should tell you everything you need to know. You basically just edit the theme files to get the layout that you want. The best way to learn truly is to experiment. If you have a specific question I could help you with that, but to tell everything involved in creating a custom theme would go way beyond the scope of an answer for this site.

Drupal Templating/Theming Resources or Advice?

I'm interested in creating a custom theme for a Drupal site I'm working on. I am new to Drupal, however I have a decent bit of experience in working with the underlying concepts that it seems are needed to build a theme (CSS, PHP, HTML).
So, my question is - where do I start? Is there a canonical guide to creating Drupal themes? Resources that I should be aware of (other than the Theming Guide)? Gotchas that others have encountered, or just general words of wisdom from those who are more experienced?
Can I recommend you install the DEVEL module
http://drupal.org/project/devel
It can give you some really insightful clues how your page is being put together.
It also comes with a really useful feature called DRUAPL THEMER INFORMATION, which when activated lets you click on parts of your page, and tells you what bits of code did what.
My second tip is try and create your own node type templates, and then find out how the node data works.
For example in the theme folder create a new file called node-story.tpl.php
<?php
print "<textarea cols=100 rows=30>". print_r($node,true) ."</textarea>";
# or krumo($node); # if you have krumo installed
print "<h1>". $node->title ."</h1>";
print "<p>" . formdat_date($node->created,"custom", "d/m/Y) ."</p>" ;
?>
Start with a starter theme and then build you own on top it. Here's a comparison table of different starter themes.
Update: There's also a starter theme review with screenshots, where the author explains them:
Starter or "base" themes are a class
of themes that seek to provide
best-practices starting points for
themers to build unique designs. Most
include a common set of features
necessary for most sites, helping to
minimize the repetition of a themer
recreating many similar files, markup
and code for each project.
The best way to do it is to start with a theme, and modify it bit by bit. That's how most of the people whom I know do it. You take the themes/garland directory and copy it to sites/all/themes/garland-modified, then you change a few things in it to reflect the new change (in principle you rename the .info file to the new directory location and you edit it to change garland to your new directory), then you go bit by bit and change things in the files to reflect your design.
This may seem tedious and a waste of time (why not just start from scratch?) but you have several advantages:
you start with a working theme
you start with a complete theme, wich everything you may want
you don't risk of forgetting pieces which are required to have a working site
There are starter kits which are supposed to make things easier (see the zen theme for example) which you basically edit in a similar way I outlined above. But I found them a bit harder to understand...
Good luck with Drupal theming :)
There is a learning curve, but I would recommend you start with the Zen Theme which has a theme starter kit included. Purchase the Drupal 6 Themes Book, Using Drupal Book and Front End Drupal and it should get you going in the right direction.
I've been learning it for almost 5 months now (coming from the Joomla world) and I have found it helpful to get to know the Drupal system by actually working with the examples from Using Drupal and the Front End Drupal Book. It really got me up to speed on how the system works, from installing modules, to configuring modules and setting up permissions and all the how to's for creating themes.
Learning how to setup a Drupal site is pertinent to building and deploying sites with Drupal as well as theming sites because the contributed modules as well as the core ones have to be over written with your own styles. Most people come into Drupal thinking that Drupal Themers are Designers but they are not. Most of them are programmers with little or no design experience and have someone else hand a pre-made design to them and then they take it integrate with Drupal. You will have to have, xhtml, css and some php experience to theme for Drupal. I hope this helps.
Here's a really top notch tutorial
http://acquia.com/community/resources/acquia-tv/tips-and-tricks-drupal-theming-90-minute-tutorial
zen as a starter theme and use the module that lets you mouseover your page and suggests page template names for those elements you want to theme. forgot the name of the module but it really kick started things for me. its not that straightforward otherwise. good luck

Where is a good guide for Drupal themeing?

I'm new to Drupal, and frankly after reading through the Drupal documentation, their guide to themeing isn't all that helpful. Maybe I'm just misunderstanding, but it seems like there are certain variables you always have access to and different functions you can define to override or implement behavior.
Long story short, I'd like to be able to trace through the Drual themeing code to understand hwo it works. Doesn't seem like it should be all that difficult, but I'm having a hard time finding a good reference. Anyone know of one?
http://www.nerdliness.com/article/2007/09/10/drupal-theming
There are a few different resources you can use that might help out:
You can use the irc channel on freenode: #drupal-themes
A module that I hear a lot of themers like is the Devel module - http://drupal.org/project/devel. This is what will allow you to trace through the code and see what variables, function calls, etc. are being used.
You might also want to check out the Druapl 6 Themes book
I'd recommend Front End Drupal: Designing, Theming, Scripting over the Drupal 6 Themes book. I put together a Drupal 6 Theming Cheat Sheet that includes links to the resources I've found most helpful.
Honestly, though there are good links and books to learn from, the way I've learned quickest was to start creating a theme. Create your theme.info file, then begin converting an index.html to page.tpl.php or page-front.tpl.php using the snippets in the cheat sheet or the nerliness.com link mentioned in Robert Harvey's answer. Those two files constitute a bare-bones theme.
From there, you can override additional template files as needed. You can use the Theme developer to find just what templates to override, to customize a particular part of the site. Remember to clear the theme cache, as you add new template files.
Also, make sure your theme has the base template of any file you want to override. See the "Note: There is a bug which prevents derivative template files from being detected..." section of the Core templates and suggestions page, for more details.

Categories