Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Child themes, CSS formats, and shortcodes...


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Oct 15, 2010, 05:40 PM
RonCrocker
 
2 posts · Aug 2010
Chicago-area
Child themes, CSS formats, and shortcodes...

(I wrote a similar post on the Wordpress forum, so I'm largely just copying that here).

Pre-apologizing for what may be an unbearably-long post.

I'm using Atahualpa 3.4.9 at http://www.roncrocker.com.

3 questions:
a) How do I make a CSS class for special paragraph formatting work in atahualpa (or wordpress or whatever may be at the root of the problem I describe below)?
b) How do I make child themes work with atahualpa, particularly on the PHP side?
c) What is the right way for me to do what I want to do?

Given those questions, here is the context:

I'm working on the next monthly report from the beer dinner - here's an example page. I have various section header-like things that I drop in the report and indented paragraphs for which the HTML code looks like:
Code:
<p><strong>Pregame Festivities: <em><span style="color: #339966; background: yellow;"> B </span></em></strong></p>
<p style="padding-left: 30px;"><em>These dinners tend to open with a complimentary pint of beer from the guest brewery. Itís not like you donít get enough beer throughout the evening, but itís a nice ice breaker.</em></p>
I end up writing that by hand, and it is a crappy way of doing it. I already know that. I was thinking this is perfect for a custom shortcode and a CSS style. Here's the shortcode/style version:
Code:
<p>[course name="Pregame Festivities" grade="B"]</p>
<p class="beer"><em>These dinners tend to open with a complimentary pint of beer from the guest brewery. Itís not like you donít get enough beer throughout the evening, but itís a nice ice breaker.</em></p>
So far, so good. Now I'd like to get my theme to support that shortcode & CSS. First thought: use a child theme and add the shortcode and formatting to the child theme-specific files. I wrote the PHP and CSS code to support the shortcode. I was able to validate the PHP by adding it to the atahualpa functions.php and see it work. I can share the PHP code, but that's not the issue, really - it's the CSS.

I tried adding the CSS to the amazingly-sparse atahualpa style.css file. I'm not a CSS expert (heck, I'm not even a novice - I'm more like primordial), so I popped over to http://www.w3schools.com/css to read a little bit. Here's what I came up with:
p.beer {padding-left: 30px;}

I've tried adding that to the style.css file and as part of the atahualpa options (in Atahualapa Options>Add HTML/CSS inserts in either the HTML Inserts: Body Tag or the CSS Inserts sections). No joy in either case, so I'm thinking I'm not using the right CSS. Once I have the right CSS (which may be now, but I'm not so sure), where do I stick that CSS? Which brings us to Question 1.

Question 1: How do I make this work in atahualpa (or wordpress or whatever happens to be at fault)?

Now let's talk about the shortcode. I have PHP code for this. This PHP code works fine, but I don't know how to get it to work in the child theme. I know it works fine because I took the nuclear option - hack it into the atahualpa functions.php file. I think this is better done in either a child theme or a plugin. Plugins are too much work (though I'll go there if that's the answer to question 3), so I started with the child theme approach.

Using a child theme, the CSS stuff then should go into the child theme style.css, and the I've tried to write a functions.php in the child theme that pulls in the base theme functions.php and then adds the shortcode handling code. That didn't seem to work. The styles don't work and the functions.php of the child theme doesn't seem to work either - I may have simply botched it and should try it again. If that's the answer, then I'll go do that and report back.

Question 2: How do I make child themes work with atahualpa, particularly on the PHP side?

Aside from questioning my sanity, the reason I did this is it seemed like the right way to do it. I don't know if it was the right way to do it or even the preferred way. This site is a hobby right now, but it may grow up. I'd rather start doing it the recommended way but I don't know what that is, leading to Question 3.

Question 3: What is the right way for me to do what I want to do?

Sorry for the long post, but thanks for your help.

Ron
  #2  
Old Oct 16, 2010, 08:39 PM
RonCrocker
 
2 posts · Aug 2010
Chicago-area
I figured out #1 - I added the following to Add HTML/CSS Inserts->CSS Inserts
Code:
div.post-bodycopy p.beer{padding-left: 30px;}
by reverse-engineering the CSS and using the "Show Web Inspector" tool in Safari.

Not so sure about how to do the PHP yet, and still wondering about doing this as a child theme. If the naming scheme changes alot, then I can see how child theme could be a problem, but if I'm willing to take the risk is it possible to make them work?

Ron

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] using css from other themes in Atahualpa oneearth Atahualpa 3 Wordpress theme 2 Oct 14, 2010 01:53 AM
[SOLVED] Child Themes / carryover sidebar formatting into new blogs wadams92101 Sidebars & Widgets 1 Jul 27, 2010 07:04 PM
Atahualpa child themes + Thesis look-a-like everyman New Versions, & Updating 3 Feb 11, 2010 11:42 AM
Child themes David Latapie Header configuration & styling 3 Nov 2, 2009 05:33 AM
Bug: with /wp-content/themes/atahualpa3/style.css.php chris Atahualpa 3 Wordpress theme 6 Dec 13, 2008 01:00 AM


All times are GMT -6. The time now is 01:15 PM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.