ThemeShaper Forums » Thematic

[closed]

Adding Dynamic Content Gallery to Functions and Home.php

(8 posts)
  • Started 13 years ago by rysch
  • Latest reply from rysch
  • This topic is not resolved
  1. I'm trying to add this plugin: http://www.studiograsshopper.ch/dynamic-content-gallery/ to a static home page.

    What I would like to do is set it up so a 900px wide feature area will be right above the leader-asides in the Power Blog Theme.

    I'm trying to figure out how to add it to functions.php and then call it in the full-width template i have called home.php

    Any suggestions? This is the code I wrote up in my functions.php but and then I'm not sure where to go after that:

    // http://codex.wordpress.org/Template_Tags/wp_page_menu
    function childtheme_featuresection{
    if( is_page('pagename') ) {
    dynamic_content_gallery();
    } ?>
    add_filter('childtheme_aboveleaders','childtheme_featuresection');

    Do I then place something into the home.php page template that I have in my child theme folder?

    Posted 13 years ago #
  2. Oops...I see that I didn't remove the comment // http://codex.wordpress.org/Template_Tags/wp_page_menu

    I wanted to make sure I got the right syntax so I copied over another function from function.php

    Posted 13 years ago #
  3. Update: I managed to get the DCG working by inserting the PHP code directly into a home.php page template. I think this will be okay for updating the thematic framework in the future, right?

    Now the only problem I need to solve is getting the feature section to appear above the leaders.

    Any suggestions? Is it okay to do this via CSS? Is that bad web design practise? I'm still a bit of a newbie on these things so...

    Posted 13 years ago #
  4. This is my code by the way:


    <?php
    /**
    * Template Name: Home
    *
    * This Full Width template removes the primary and secondary asides so that content
    * can be displayed the entire width of the #content area.
    *
    */

    // calling the header.php
    get_header();

    // action hook for placing content above #container
    thematic_abovecontainer();

    ?>
    <div id="container">
    <?php dynamic_content_gallery(); ?>
    <?php thematic_abovecontent(); ?>
    <div id="content">

    <?php

    // calling the widget area 'page-top'
    get_sidebar('page-top');

    the_post();

    thematic_abovepost();

    ?>

    <?php

    thematic_belowpost();

    // calling the widget area 'page-bottom'
    get_sidebar('page-bottom');

    ?>

    </div><!-- #content -->

    <?php thematic_belowcontent(); ?>

    </div><!-- #container -->

    <?php

    // action hook for placing content below #container
    thematic_belowcontainer();

    // calling footer.php
    get_footer();

    ?>

    Posted 13 years ago #
  5. This is the code that I have written up to place a new container box above the leaders to fit the DCG:

    // This will add an area for the feature box to sit
    function childtheme_featureaside() { ?
    <?php if ( is_page_template('home.php')) { ?>
    <div id="feature">
    <div id="feature-container">
    <?php dynamic_content_gallery(); ?>
    </div>
    </div>
    <?php }
    add_action('thematic_featureaside', 'childtheme_feature_aside', 4);

    Posted 13 years ago #
  6. @rysch

    did you get it working?

    i can see an obvious missing '}' from the code directly above.
    should be...

    // This will add an area for the feature box to sit
    function childtheme_featureaside() {
    <?php if ( is_page_template('home.php')) { ?>
    <div id="feature">
    <div id="feature-container">
    <?php dynamic_content_gallery(); ?>
    </div>
    </div>
    <?php }
    }
    add_action('thematic_featureaside', 'childtheme_feature_aside', 4);

    but i'm just correcting the snippet, haven't tested the function. you may want to try other hooks, such as below_header, etc.

    hope this helps.

    Posted 13 years ago #
  7. where is the "thematic_feature_aside" hook? I'm not super familiar w/ the power blog theme and it isn't in the regular thematic. is it in the sidebar? doesn't look like your template calls the thematic sidebar so if i'm right in all my assumptions then your code would never get called on this page. i don't see a problem with pasting the code into a custom template as you have done.

    Posted 13 years ago #
  8. Thanks for the replies. I managed to get it working by adding it right above the leader asides hook in the functions.php.

    Many thanks!

    Posted 13 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.