This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

WordPress Development

My recent threads

You haven't posted any discussions yet.

Recently updated threads

Second Assignment - Dying on the Vine

Go back to: General discussion

I have allowed myself only 4-5 hours to complete this week's assignment <insert travelling, work, parenthood, snow storm excuses here> and I have now used up the allotted time I allocated.  I cannot understand how to complete this assignment.

The first tip was to use child themes - I read the suggested material and created a child them based upon my existing parent (a custom template developed using the tool Artisteer - which I love).

I then used FireBug plugin for FireFox to identify which CSS reference is defining the look and feel of the post on my primary blog page.  I deteremined how to change the background color of the post, and pasted that specific code in the new styles.css file for the child theme.  I confirmed that it is working properly by toggling between the parent and child themes and I can see the change to the article background color.

NOW - I am trying to determine how and where I need to tell the Theme files to select which template based on the category ID.

  • I do not know how to read or code in PHP.  I barely understand the basic premise, though I do understand database technology and structure, and I understand very basic scripting language.
  • I do not know how to decipher all of CSS, despite taking a very rudimentary tutorial on same.
  • I enrolled in this class under the premise that I did not need to know those things. 

I have tried the in_category logic, and the get_template_part logic, but have no clue how to edit them for my specific purposes (do I need to tell it where the template is located, directory structure, or does it just know to look for the directory name?) or where in the code to put them (I can "find" the loop, but do I need to modify existing code, or insert the If... else logic for the category?) and (does the category "hook" exist, does my index.php know which post is in which category?)  I have NO CLUE.

What I like about this class:

  • It gives me assignments of specific functionality I wouldn't seek on my own.
  • It gives me scheduled assignments to give me a target of what to learn and when, causing me some sense of urgency for learning.

What I have trouble with:

  • There is no actual "instruction", I am left to read comments of other students and research results.  This is how learning works in the workplace after there has been some actual instruction. I am a blank slate every week, as I would be without a course.
  • Students come from all different skill backgrounds, so some level of knowledge is assumed, leaving students without the right underlying skillset frustrated.

I'm beginning to wonder if I shouldn't read a Wordpress book first, and then re-enroll in a similar course?

Please help.

Alexey Polarny's picture
Alexey Polarny
Sun, 2011-02-06 07:57

Jason, i think you really should read a book or two on php, as it's the core of wordpress, having understood the basics, you will be able to work with themes and templates,but if you only copypaste from tutorials it will not stay in your head for long. Understanding a few principles makes you free from memorizing lots of facts. Good luck there.

James Dunn's picture
James Dunn
Sun, 2011-02-06 08:15

Jason, Alexey is correct - if you want to dig around in code and be a code monkey. But, you can accomplish this WITHOUT modifying a single line of code - just adding the information into your CSS sheet (style.css) in the child theme. In fact, that is the only thing needed in the child theme is the style.css. But, you will need a theme that is capable of being modified with a child theme.

I spent about 4 hours working on this with my chosen theme only to discover that the theme would not allow me to modify these settings in a child theme. I tried an additional dozen or so themes over the next few hours until I found one that would work with a child theme.

The syntax of the CSS is pretty simple once you know the hooks that you need to modify. (I think hooks is the right term - it's very late/early here and I'm a little punchy). Anyway, you can do this without digging into the .php files - and if I understood Nuno's instructions, that was the objective - do it without digging into the .php files.

If you don't do this using a child theme, then with each update of the theme from the originator of the theme, you'll have to go back in and modify the theme again. That's the idea of the child theme, create a theme based upon a parent theme, with modifications that are not affected by the parent theme. Pretty slick concept that I wish had been around a couple of years ago.

Good luck on this - rest your mind a few hours and come back to it - sometimes that is the best thing for me.