WordPress.org

Ready to get started?Download WordPress

Forums

Child theme, CSS formats, and Atahualpa (2 posts)

  1. Ron C
    Member
    Posted 3 years ago #

    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:

    <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:

    <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?

    My PHP code works fine, but I don't know how to get it to work in the child theme. 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.
    I'm looking for a little bit of advice on making it work, up to and including the nuclear option ("hack it into the atahualpa functions.php file"). That brings us to Question 2.

    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. esmi
    Forum Moderator
    Posted 3 years ago #

    Try asking on the Atahualpa Forum: http://forum.bytesforall.com/

Topic Closed

This topic has been closed to new replies.

About this Topic