ThemeShaper Forums » Thematic

[closed]

syntax question re: childtheme_override

(4 posts)
  • Started 3 years ago by ridgely
  • Latest reply from em hr
  • This topic is resolved
  1. Using the latest stable dev with childtheme_override functions available - question about syntax.
    Most of the time the childtheme_override looks like this:

    if (function_exists('childtheme_override_something')) {
    function thematic_something() {
    childtheme_override_something();
    }
    } else {
    function thematic_something() {....;}}

    ...which simply requires the child theme to contain function childtheme_override_something(); somewhere in functions.php.

    But a bunch of the postheader and postfooter subfunctions are like:


    if (function_exists('childtheme_override_something')) {
    function thematic_something() {
    return childtheme_override_something();
    }
    } else {
    function thematic_something() {....;}}

    Does this require any accommodating syntax change in the childtheme_override function?

    Posted 3 years ago #
  2. Hi ridgely,

    If the original function is return(ing) a variable, then the override needs to be return(ed) as well.

    When you're looking at the override functions this is a good determiner of whether you can echo or if you need end your override with a return.

    -Gene

    Posted 3 years ago #
  3. Thanks Gene. I successfully overrode my very first postfooter, with my own subfunctions. :)
    Will probably start a new tip thread for custom post postfooters.

    Posted 3 years ago #
  4. Nice :)

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.