Portfolio Templates, Gallery php & Wordpress

Hello! First off thank you so much for taking the time to read this. I am so unbelievably confused. I am using this template called SAVEDFORWEB by Beaches. This theme allows you to create portfolios and choose different portfolio templates to use. The one portfolio template I would like to use is called “portfolio-next-button.php”. It showcases simply one of your photos at a time and you just press forward or backward to see different photos. There is another template you can choose that is called “portfolio-thumbnail-grid.php”. On this template it starts as a grid but if you click on one of the photos in the grid it then turns into what I want with the "portfolio-next-button.php " The problem is I do not want a grid and if I can’t fix this setting, I can’t use this theme. I love this theme and on the demo this feature worked. I think something may have gotten screwed up in an update or something but I have no idea. There is no support or documentation anywhere for this theme. It is a free theme. I can see that the code in the portfolio template I would like to use is incorporating the default portfolio template which doesn’t make sense. I think this may be an easy fix but, again, I have no clue. I have never been on this help site but I appreciate everyone who takes the time and obviously anyone who can help. Thanks in advance!!! If you need more info please ask.

http://bceverything.com/portfolio/book-3/ This is the link with the thumbnail grid template used.
[php]<?php
/**

  • Portfolio Template: Thumbnail Grid

  • Beaches thumbnail grid gallery

  • Upload images into the WordPress gallery. Do NOT use the

  • [gallery] shortcode, the images will display automatically.

  • @package Save for Web

  • @since 0.4.9
    */
    get_header(); // Loads the header.php template. ?>

    <?php do_atomic( 'before_content' ); // saveforweb_before_content ?>
     <?php do_atomic( 'open_content' ); // saveforweb_open_content ?>
    
     <div class="hfeed">
    
     	<?php if ( have_posts() ) : ?>
    
     		<?php while ( have_posts() ) : the_post(); ?>
    
     			<?php do_atomic( 'before_entry' ); // saveforweb_before_entry ?>
    
     			<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
    
     				<?php do_atomic( 'open_entry' ); // saveforweb_open_entry ?>
    
     				<?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
    
     				<div class="entry-content">
     					
     					<?php get_template_part( 'gallery', 'thumb-grid' ); // Loads the gallery-thumb-grid.php template. ?>
     					
     					<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', hybrid_get_textdomain() ) ); ?>
     				
     				</div><!-- .entry-content -->
    
     				<?php echo apply_atomic_shortcode( 'entry_meta', '<div class="entry-meta">[entry-edit-link]</div>' ); ?>
    
     				<?php do_atomic( 'close_entry' ); // saveforweb_close_entry ?>
    
     			</div><!-- .hentry -->
    
     			<?php do_atomic( 'after_entry' ); // saveforweb_after_entry ?>
    
     			<?php do_atomic( 'after_singular' ); // saveforweb_after_singular ?>
    
     		<?php endwhile; ?>
    
     	<?php endif; ?>
    
     </div><!-- .hfeed -->
    
     <?php do_atomic( 'close_content' ); // saveforweb_close_content ?>
    
    <?php do_atomic( 'after_content' ); // saveforweb_after_content ?>
<?php get_footer(); // Loads the footer.php template. ?>[/php]

http://bceverything.com/portfolio/book-one/ This is the link with the next-button template used.
[php]<?php
/**

  • Portfolio Template: Next/Back Buttons
  • Save for Web’s next/back button gallery
  • Upload images into the WordPress gallery. DO NOT use the
  • [gallery] shortcode, the images will display automatically.
  • @package Save for Web
  • @subpackage Template
    */
    get_header(); // Loads the header.php template. ?>
<?php do_atomic( 'before_content' ); // saveforweb_before_content ?>
<div id="content">

	<?php do_atomic( 'open_content' ); // saveforweb_open_content ?>

	<div class="hfeed">

		<?php if ( have_posts() ) : ?>

			<?php while ( have_posts() ) : the_post(); ?>

				<?php do_atomic( 'before_entry' ); // saveforweb_before_entry ?>

					<div class="slide-control">
						<span class="prev">Prev</span>|<span class="next">Next</span><span class="info"></span>
					</div>

					<?php get_template_part( 'gallery', 'default' ); // Loads the gallery-default.php template. ?>

				<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">

					<?php do_atomic( 'open_entry' ); // saveforweb_open_entry ?>

					<?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
					
					<div class="entry-content">
						
					<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', hybrid_get_textdomain() ) ); ?>
					
					</div><!-- .entry-content -->

					<?php echo apply_atomic_shortcode( 'entry_meta', '<div class="entry-meta">[entry-edit-link]</div>' ); ?>

					<?php do_atomic( 'close_entry' ); // saveforweb_close_entry ?>

				</div><!-- .hentry -->

				<?php do_atomic( 'after_entry' ); // saveforweb_after_entry ?>

				<?php do_atomic( 'after_singular' ); // saveforweb_after_singular ?>

			<?php endwhile; ?>

		<?php endif; ?>

	</div><!-- .hfeed -->

	<?php do_atomic( 'close_content' ); // saveforweb_close_content ?>

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

<?php do_atomic( 'after_content' ); // saveforweb_after_content ?>
<?php get_footer(); // Loads the footer.php template. ?>[/php]

http://saveforweb.org/getting-started/portfolios/ This is the homepage for my theme.

Also, here is the gallery-default.php:
[php]<?php
/**

  • Gallery Image Default
  • displays Portfolio image attachments
  • captions and descriptions will display, if availible
  • @package Save for Web
  • @subpackage Portfolio Gallery Template
    */
    ?>
<?php $args = array(
		'order' => 'ASC',
		'orderby' => 'menu_order',
		'post_type' => 'attachment',
		'post_parent' => $post->ID,
		'post_mime_type' => 'image',
		'post_status' => null,
		'numberposts' => -1,
		);
	$i=1;	
	$attachments = get_posts($args);
	foreach ($attachments as $attachment) :	setup_postdata($post); ?>

<div id="image-<?php echo $i; ?>" class="image">					

	<div class="image-wrapper">						

		<?php echo wp_get_attachment_image($attachment->ID, 'full', false, false); ?>	

		<div class="image-info">
			<?php $image_caption = apply_filters( 'the_excerpt' , $attachment->post_excerpt );
				 if (isset($image_caption)) echo $image_caption; ?>
			<?php $image_description = apply_filters( 'the_content' , $attachment->post_content);
				 if (isset($image_description)) echo $image_description; ?>

		</div><!-- .image-info -->

	</div><!-- .image-wrapper -->

</div><!-- .image -->

<?php $i++; endforeach; ?>
[/php]

and theme functions:
[php]<?php
/**

  • The functions file is used to initialize everything in the theme. It controls how the theme is loaded and
  • sets up the supported features, default actions, and default filters. If making customizations, users
  • should create a child theme and make changes to its functions.php file (not this one). Friends don’t let
  • friends modify parent theme files. :wink:
  • Child themes should do their setup on the ‘after_setup_theme’ hook with a priority of 11 if they want to
  • override parent theme features. Use a priority of 9 if wanting to run before the parent theme.
  • This program is free software; you can redistribute it and/or modify it under the terms of the GNU
  • General Public License version 2, as published by the Free Software Foundation. You may NOT assume
  • that you can use any other version of the GPL.
  • This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  • even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • You should have received a copy of the GNU General Public License along with this program; if not, write
  • to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  • @package Save for Web
  • @subpackage Functions
  • @version 0.1.0
  • @author Beaches [email protected], Justin Tadlock [email protected]
  • @copyright Copyright © 2010, Project Beaches
  • @link http://buildbeaches.com
  • @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    */

/* Load the core theme framework. */
require_once( trailingslashit( TEMPLATEPATH ) . ‘library/hybrid.php’ );

$theme = new Hybrid();

/* Do theme setup on the ‘after_setup_theme’ hook. */
add_action( ‘after_setup_theme’, ‘saveforweb_theme_setup’ );

/**

  • Theme setup function. This function adds support for theme features and defines the default theme

  • actions and filters.

  • @since 0.3.0
    */
    function saveforweb_theme_setup() {

    /* Get action/filter hook prefix. */
    $prefix = hybrid_get_prefix();

    /* Add theme support for core framework features. */
    add_theme_support( ‘hybrid-core-menus’, array( ‘primary’, ‘subsidiary’ ) );
    add_theme_support( ‘hybrid-core-sidebars’, array( ‘header’, ‘subsidiary’ ) );
    add_theme_support( ‘hybrid-core-widgets’ );
    add_theme_support( ‘hybrid-core-shortcodes’ );
    add_theme_support( ‘hybrid-core-post-meta-box’ );
    add_theme_support( ‘hybrid-core-theme-settings’ );
    add_theme_support( ‘hybrid-core-meta-box-footer’ );
    add_theme_support( ‘hybrid-core-seo’ );
    add_theme_support( ‘hybrid-core-template-hierarchy’ );

    /* Add theme support for framework extensions. */
    add_theme_support( ‘dev-stylesheet’ );
    add_theme_support( ‘loop-pagination’ );
    add_theme_support( ‘get-the-image’ );
    add_theme_support( ‘cleaner-gallery’ );

    /* Add theme support for WordPress features. */
    add_theme_support( ‘automatic-feed-links’ );

    /* Add theme support for post editor styling */
    add_editor_style();

    /* Create Portfolio post type. */
    add_action( ‘init’, ‘saveforweb_create_portfolio’ );

    /* Register Google hosted jQuery, and cycle plugins. */
    add_action( ‘template_redirect’, ‘saveforweb_google_jquery’ );

    /* Register Portfolio post type jQuery and CSS. */
    add_action( ‘template_redirect’, ‘saveforweb_portfolio_files’ );

    /* Filter default Core theme settings. */
    add_filter( “{$prefix}_default_theme_settings”, ‘saveforweb_default_theme_settings’ );

    /* Filter default Core post byline. */
    add_filter( “{$prefix}_byline”, ‘saveforweb_byline’ );

    /* Disable WP Gallery. */
    add_filter( ‘post_gallery’, ‘saveforweb_wp_gallery_shortcode’ );

    /* Disable sidebars. */
    add_filter( ‘sidebars_widgets’, ‘saveforweb_disable_sidebars’ );

    /* Disable menu locations. */
    add_filter( ‘theme_mod_nav_menu_locations’, ‘saveforweb_disable_menus’ );

    /* Add body classes. */
    add_filter( ‘body_class’, ‘saveforweb_body_class’ );

    /* Removed add_theme_supports
    add_theme_support( ‘hybrid-core-drop-downs’ );
    add_theme_support( ‘theme-layouts’, array( ‘1c’, ‘2c-l’, ‘2c-r’, ‘3c-l’, ‘3c-r’, ‘3c-c’ ) );
    add_theme_support( ‘post-stylesheets’ );
    */

    /* Add features

    / Embed width/height defaults. /
    add_filter( ‘embed_defaults’, ‘saveforweb_embed_defaults’ );

    */

    /* Add the portfolio template “Thumbnail Grid” custom image size */
    add_image_size( ‘thumb-grid’, 200, 200, false );

}

/* DEPRECATED REMOVE IN SAVEFORWEB 0.5.0

  • Filter default Prototype Post bylines
    */
    function saveforweb_byline( $byline ) {

    $byline = ‘

    [entry-published] [entry-edit-link before=" | "]

    ’;

    return $byline;
    }

/**

  • Load Google hosted Jquery, except in the WordPress admin

  • @since 0.1.0
    */
    function saveforweb_google_jquery() {

    if ( !is_admin() ) {

     wp_deregister_script('jquery'); 
    
     wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"), false, '1.4.4', false); 
    
     wp_enqueue_script('jquery');
    

    }
    }

/**

  • Register Cycle and Colorbox plugins on their individual portfolio templates. Register the portfolio stylesheet

  • @revised 0.4.9

  • @since 0.1.0
    */
    function saveforweb_portfolio_files() {

    if ( ‘portfolio’ == get_post_type() ) {

     global $wp_query;
    
     $template = get_post_meta( $wp_query->post->ID, "_wp_{$wp_query->post->post_type}_template", true );
    
     wp_enqueue_style( 'portfolio-style', CHILD_THEME_URI . '/css/portfolio.css', false, '0.4', 'screen' );
    
     if ( $template == 'portfolio-thumbnail-grid.php' || $template == 'portfolio-index.php' ) {
    
     	wp_enqueue_script( 'functions-colorbox', THEME_URI . '/js/functions.dev.colorbox.js', array('jquery'), 0.4 );
    
     	wp_enqueue_script( 'colorbox', THEME_URI . '/js/jquery.colorbox.dev.js', array('jquery'), 0.4 );
     }
    
     if ( $template == 'portfolio-next-button.php' ) {
    
     	wp_enqueue_script( 'functions-cycle', THEME_URI . '/js/functions.cycle.js', array('jquery'), 0.4 );
    
     	wp_enqueue_script( 'cycle', THEME_URI . '/js/jquery.cycle.min.js', array('jquery'), 0.4 );
     }		
    

    }
    }

/**

  • Disable WordPress [gallery] shortcode on portfolios. Image attachments are automatically queried for portfolios.

  • @revised 0.4.2

  • @since 0.1.0
    */
    function saveforweb_wp_gallery_shortcode( $gallery ) {

    if ( ‘portfolio’ == get_post_type() )

     return '';	
    

    return $gallery;
    }

/**

  • Disable subsidiary sidebar on portfolio pages

  • @revised 0.4.2

  • @since 0.3.0
    */
    function saveforweb_disable_sidebars( $sidebars_widgets ) {

    global $wp_query;

    if ( ‘portfolio’ == get_post_type() || is_page_template(‘page-template-random-image.php’) ) {

     $sidebars_widgets['subsidiary'] = false;
    

    }

    return $sidebars_widgets;
    }

/**

  • Disable subsidiary menu if viewing the front page.

  • @since 0.3.0
    */
    function saveforweb_disable_menus( $locations ) {

    if ( isset( $locations[‘subsidiary’] ) && is_page_template(‘page-template-random-image.php’) ) {

     $locations['subsidiary'] = false;
    

    }

    return $locations;
    }

/**

  • Add additional classes.

  • @hybrid 0.9

  • @revised 0.4.1

  • @since 0.3.0
    */
    function saveforweb_body_class( $classes ) {
    global $wp_query, $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome;

    /* Singular post classes (deprecated). */
    if ( is_singular() ) {

     if ( is_page() )
     	$classes[] = "page-{$wp_query->post->ID}"; // Use singular-page-ID
    
     elseif ( is_singular( 'post' ) )
     	$classes[] = "single-{$wp_query->post->ID}"; // Use singular-post-ID
    

    }

    /* Browser detection. */
    $browsers = array( ‘gecko’ => $is_gecko, ‘opera’ => $is_opera, ‘lynx’ => $is_lynx, ‘ns4’ => $is_NS4, ‘safari’ => $is_safari, ‘chrome’ => $is_chrome, ‘msie’ => $is_IE );
    foreach ( $browsers as $key => $value ) {
    if ( $value ) {
    $classes[] = $key;
    break;
    }
    }

    /* Hybrid theme widgets detection. */
    foreach ( array( ‘header’, ‘primary’, ‘secondary’, ‘subsidiary’ ) as $sidebar )
    $classes[] = ( is_active_sidebar( $sidebar ) ) ? “{$sidebar}-active” : “{$sidebar}-inactive”;

    if ( in_array( ‘header-inactive’, $classes ) && in_array( ‘primary-inactive’, $classes ) && in_array( ‘secondary-inactive’, $classes ) && in_array( ‘subsidiary-inactive’, $classes ) )
    $classes[] = ‘no-widgets’;

    /* Menu detection */
    foreach ( array( ‘primary’, ‘secondary’, ‘subsidiary’ ) as $menu )
    $classes[] = ( has_nav_menu( $menu ) ) ? “{$menu}-menu-active” : “{$menu}-menu-inactive”;

    /* Return the array of classes. */
    return $classes;
    }

/*Filter default Core Footer Settings */
function saveforweb_default_theme_settings( $settings ) {

$settings['footer_insert'] = '<p class="copyright">Copyright &#169; [the-year] [theme-link] Built by Beaches</p>';

return $settings;

}

/**

  • Registers the custom post type Portfolio.
  • @since 0.4.0
    */
    function saveforweb_create_portfolio() {
    register_post_type( ‘portfolio’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Portfolios’ ),
    ‘singular_name’ => __( ‘Portfolio’ ),
    ‘add_new’ => __( ‘Add New’ ),
    ‘add_new_item’ => __( ‘Add New Portfolio’ ),
    ‘edit’ => __( ‘Edit’ ),
    ‘edit_item’ => __( ‘Edit Portfolio’ ),
    ‘new_item’ => __( ‘New Portfolio’ ),
    ‘view’ => __( ‘View Portfolio’ ),
    ‘view_item’ => __( ‘View Portfolio’ ),
    ‘search_items’ => __( ‘Search Portfolios’ ),
    ‘not_found’ => __( ‘No portfolios found’ ),
    ‘not_found_in_trash’ => __( ‘No portfolios found in Trash’ ),
    ‘parent’ => __( ‘Parent Gallery’ )
    ),
    ‘supports’ => array( ‘title’, ‘editor’, ‘excerpt’, ‘thumbnail’, ‘page-attributes’, hybrid_get_prefix() . ‘-post-settings’ ),
    ‘hierarchical’ => true,
    ‘public’ => true,
    ‘exclude_from_search’ => true,
    ‘menu_position’ => 22,
    ‘has_archive’ => true,
    ‘rewrite’ => array( ‘slug’ => ‘portfolio’, ‘with_front’ => false )
    )
    );
    }

?>[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service