How to add slideshow from Nextgen Gallery wordpress plugin into your custom theme

November 14th, 2011 § 0 comments § permalink

Drop this code to header.php (for example if you want show it on header), put your gallery ID in [slideshow=1] (when your gallery ID is 1)

<?php
$showgallery = '[slideshow=1]';
$showgallery = apply_filters('the_content', $showgallery );
echo $showgallery;
?>

Then, adjust your slideshow width and height on Nextgen Gallery’s slideshow option, and your layout css off course.

Good luck :’)

How to widgetize your wordpress theme

November 14th, 2011 § 0 comments § permalink

Put this code on functions.php (if you don’t have the file, create one inside your theme folder):

<?php
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '',
        'after_widget' => '',
        'before_title' => '<div class="title">',
        'after_title' => '</div>',
    ));
?>

then format sidebar.php with this code (if you don’t have the file, create one inside your theme folder):

<div id="sidebar">
<?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar() ) : ?>
 <div class="title">About</div>
 <p>This is my blog.</p>
 <div class="title">Links</div>
 <ul>
  <li><a href="http://example.com">Example</a></li>
 </ul>
<?php endif; ?>
</div>

Now kick in some widgets from Admin > Appearance > Widgets and adjust the interface with your CSS :)

Show childpage/subpage only from current page

November 10th, 2011 § 0 comments § permalink

    <ul>
        <?php
            $pages = get_pages('child_of='.$post->ID.'&sort_column=post_title');
            $count = 0;
            foreach($pages as $page)
            { ?>

        <li><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></li><?php
            }
        ?>
    </ul>

Where Am I?

You are currently browsing the Wordpress category at viar ms.