ThemeShaper Forums » Thematic

[closed]

problem with action hook

(12 posts)
  • Started 10 years ago by crzy4prple
  • Latest reply from Chris
  • This topic is resolved

Tags:

  1. crzy4prple
    Member

    This is the code I've got, but it's not displaying what am I doing wrong

    //welcome theme
    function childtheme_welcome_blurb() {
    if (is_home() & !is_paged()) { ?>

    <!– our welcome blurb starts here –>
    <div id="welcome-blurb">
    <p>Welcome to <?php bloginfo('name'); ?>.</p>
    </div>
    <!– our welcome blurb ends here –>
    <?php }

    } // end of our new function childtheme_welcome_blurb

    // Now we add our new function to our Thematic Action Hook
    add_action('thematic_abovemainasides','childtheme_welcome_blurb');

    ?>

    Posted 10 years ago #
  2. Hi,

    I'm not sure what is going wrong for you. I tested this code and it works for me. Are you sure you have pasted the code into the active child theme's functions.php.

    -Gene

    Posted 10 years ago #
  3. crzy4prple
    Member

    Yes I have it in the functions.php of the child theme.

    Posted 10 years ago #
  4. crzy4prple
    Member

    <?php get_header(); ?>

    <div id="container">
    <div id="content">

    <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>

    <?php } ?>

    <?php /* The Loop — with comments! */ ?>
    <?php while ( have_posts() ) : the_post() ?>

    <div class="datebg">
    <div class="month"><?php the_time(M) ?></div>
    <div class="day"><?php the_time(d) ?></div>
    </div>

    <?php /* Create a div with a unique ID thanks to the_ID() and semantic classes with post_class() */ ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php /* an h2 title */ ?>
    <h2 class="entry-title">" title="<?php printf( __('Permalink to %s', 'beenblinged'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></h2>

    <?php /* Microformatted category and tag links along with a comments link */ ?>
    <div class="entry-utility">
    <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( '', 'beenblinged' ); ?></span><?php echo get_the_category_list(', '); ?></span>
    <!--<span class="meta-sep"> | </span> -->
    <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'beenblinged' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ) ?>
    <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'beenblinged' ), __( '1 Comment', 'beenblinged' ), __( '% Comments', 'beenblinged' ) ) ?></span>
    <?php edit_post_link( __( 'Edit', 'beenblinged' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ) ?>
    </div><!-- #entry-utility -->

    <?php /* The entry content */ ?>
    <div class="entry-content">
    <?php the_content( __( 'Continue reading <span class="meta-nav">»</span>', 'beenblinged' ) ); ?>
    <?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'beenblinged' ) . '&after=</div>') ?>
    </div><!-- .entry-content -->

    <?php /* Microformatted, translatable post meta */ ?>
    <div class="entry-meta">
    <!-- <span class="meta-prep meta-prep-author"> <?php _e('By ', 'beenblinged'); ?></span>
    <span class="author vcard">ID, $authordata->user_nicename ); ?>" title="<?php printf( __( 'View all posts by %s', 'beenblinged' ), $authordata->display_name ); ?>"><?php the_author(); ?></span>
    <span class="meta-sep"> | </span>
    <span class="meta-prep meta-prep-entry-date"><?php _e('Published ', 'beenblinged'); ?></span>-->
    <span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time( get_option( 'date_format' ) ); ?></abbr></span>
    <?php edit_post_link( __( 'Edit', 'beenblinged' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?>
    </div><!-- .entry-meta -->

    </div><!-- #post-<?php the_ID(); ?> -->

    <?php /* Close up the post div */ ?>

    <?php endwhile; ?>

    <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
    <div id="nav-below" class="navigation">
    <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">«</span> Older posts', 'beenblinged' )) ?></div>
    <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">»</span>', 'beenblinged' )) ?></div>
    </div><!-- #nav-below -->
    <?php } ?>

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

    <?php get_sidebar() ?>
    <?php get_footer() ?>

    That's the code from my index page, am I missing something?

    Posted 10 years ago #
  5. Have you modified the header.php?

    Chris

    Posted 10 years ago #
  6. crzy4prple
    Member

    here's my header:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head profile="http://gmpg.org/xfn/11">
    <title><?php
    if ( is_single() ) { single_post_title(); }
    elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); }
    elseif ( is_page() ) { single_post_title(''); }
    elseif ( is_search() ) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); get_page_number(); }
    elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; }
    else { bloginfo('name'); wp_title('|'); get_page_number(); }
    ?></title>

    <meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />

    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>

    <?php wp_head(); ?>

    <link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>" title="<?php printf( __( '%s latest posts', 'beenblinged' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
    <link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>" title="<?php printf( __( '%s latest comments', 'beenblinged' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    </head>

    <body <?php body_class(); ?>>
    <div id="wrapper" class="hfeed">

    <div id="header">
    <div id="masthead">

    <div id="branding">
    <!-- <div id="blog-title"><span>
    /" title="<?php bloginfo( 'name' ) ?>" rel="home"><?php bloginfo( 'name' ) ?></span></div> -->
    <?php if ( is_home() || is_front_page() ) { ?>
    <!-- <h1 id="blog-description"><?php bloginfo( 'description' ) ?></h1> -->
    <?php } else { ?>
    <!-- <div id="blog-description"><?php bloginfo( 'description' ) ?></div> -->
    <?php } ?>
    </div><!-- #branding -->

    <div id="access">
    <div class="skip-link">"><?php _e( 'Skip to content', 'beenblinged' ) ?></div>
    <!-- <?php wp_page_menu( 'sort_column=menu_order' ); ?> -->
    </div><!-- #access -->

    </div><!-- #masthead -->
    </div><!-- #header -->

    <div id="main">

    Posted 10 years ago #
  7. You removed the action hook :)

    Posted 10 years ago #
  8. Sorry .. my fault ..

    check your sidebar.php for thematic_abovemainasides()

    Chris

    Posted 10 years ago #
  9. crzy4prple
    Member

    I haven't don't have a sidebar loaded for theme, so it's pulling from the thematic sidebar.

    Posted 10 years ago #
  10. crzy4prple
    Member

    I'm bumping this because I'm still having issues :(

    Posted 10 years ago #
  11. Could you please provide an URL or zip your Thematic directory and your child theme's directory and mail it to chris (at) wupperpiraten (dot) de ?!

    Chris

    Posted 10 years ago #
  12. .. got it .. email should be on its way in a couple of minutes.

    Chris

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.