+8801 616 169 990
+

Blog

7

Jun, 2011

Display Google Adsense after first post

By: | Tags: , , , | Comments: 0

If you are using Genesis Theme Framework and would like to display Google Adsense or any advertisement code after the first post on the homepage, archives, and search results page, add the code below to the child theme’s functions.php file. add_action(‘genesis_after_post’, ‘aycchildthemes_ad_after_first_post’); function aycchildthemes_ad_after_first_post() { global $loop_counter; if (!is_singular() && $loop_counter == 0) { ?> ADD YOUR GOOGLE ADSENSE CODE HERE <?php } } The code above which you add should be placed anywhere after this: require_once(TEMPLATEPATH.’/lib/init.php’); And before the following closing code (if it exists): ?> That’s it. Let […]

READ MORE

7

Jun, 2011

Page specific sidebar content in Genesis framework wordpress

By: | Tags: , , , , | Comments: 0

This is a simple task if you use the built in is_page() conditional tag in WordPress and use one of the Genesis structural action hooks. We’ll be using the genesis_before_sidebar_widget_area action hook in this example. <?php // Add additional sidebar content to the book page add_action(‘genesis_before_sidebar_widget_area’, ‘child_genesis_sidebar’); function child_genesis_sidebar() { if ( is_page(‘__SPECIFIC-PAGE-ID-OR-TITLE__’)) { ?> <your-content-code> <?php } } ?>

READ MORE

7

Jun, 2011

Quick Tips of Genesis Framework

By: | Tags: , , , , , , | Comments: 0

There’s a lot of small code snippets I use often. This is where I’ll collect them. If you have any quick tips, feel free to share in the comments. Force a page layout This is very useful for ensuring custom pages you build for a client aren’t broken by them changing the page layout (ex: home page). Or, changing the page layout to something other than the default on archive pages (ex: category). The example below is to set the category page to Sidebar-Content-Sidebar. // Force layout on category add_filter(‘genesis_pre_get_option_site_layout’, […]

READ MORE
Share with your friends










Submit