Using our official WordPress Plugin, you can integrate all of your inventory data (in near real-time) directly into your website. This plugin will automatically sync your SalesBinder data into WordPress and create a custom post type for easy integration with any Theme.
As an example of how to display your newly synchronized inventory list using this plugin, have a look at the following example below. This shows you how you could modify the basic "twentytwelve" WordPress Theme to display your synchronized inventory list.
Save this new file in the root of your theme's folder (ie. /wp-content/themes/YourThemeName/).
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_single() ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else : ?> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a> </h1> <?php endif; // is_single() ?> </header> <div class="entry-content"> <?php the_content(); ?> <h2>Price: <?php sb_the_price() ?></h2> <h2>Images</h2> <?php is_single() ? sb_the_images() : sb_the_image(1); ?> <h2>Details</h2> <?php sb_the_custom_fields(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-meta --> </article><!-- #post -->
This is a snippet to show how you can modify the index.php file to check the Post Type and use the new file we created above.
<?php if ( have_posts() ) : ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php if (get_post_type() == 'salesbinder_item') get_template_part( 'content', get_post_type() ); else get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentytwelve_content_nav( 'nav-below' ); ?> <?php else : ?>
These are also snippets of how you could modify the other files.
single.php
<?php while ( have_posts() ) : the_post(); ?> <?php if (get_post_type() == 'salesbinder_item') get_template_part( 'content', get_post_type() ); else get_template_part( 'content', get_post_format() ); ?>
archive.php:
<?php /* Start the Loop */ while ( have_posts() ) : the_post(); if (get_post_type() == 'salesbinder_item') get_template_part( 'content', get_post_type() ); else get_template_part( 'content', get_post_format() ); endwhile;