WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Mar 31 2011

How to Make a Private eCommerce Store Using Shopp

So one person asked if I could make Shopp available for users who have a registered customer login that they control. So the first thing you have to do is setup Shopp on the backend by allowing Customer Accounts via Shopp > Settings > Checkout. I always select Enable Account Logins integrated with WordPress Accounts just in case the person wants to move towards some sort of Client Portal as well.

Then in Shopp > Settings > Presentation, I used Enable theme templates, which enables me to edit some files without having to worry about hacking core (never hack core!) to customize the way I want it. So then I open my catalog.php template file. As you can see the catalog.php template consists of only one line.

[php]<?php shopp('catalog','catalog-products'); ?>[/php]

Then I open login.php template file, which contains the login information I need for a private ecommerce store for my customers, or my invite-only elite customers. I copy the entire file and paste it with my catalog.php. Then I add one line ahead of the login.php file:
[php]if( ! shopp('customer','loggedin')) {
//login.php login form code
}
else
shopp('catalog','catalog-products');
[/php]

Don't forget that you may also want to hide/unregister your sidebars, or if you are using a genesis theme you can force a content only layout.

So now my store page which calls the shortcode [ catalog ] will now refer to my edited template forcing customers to login before they can see anything. Since I have my customers connected to WordPress accounts, I could also refer customers to the WordPress login screen. Since my store was a bit more complicated as I used a secondary menu system (full of custom links referring to Shopp Categories), connecting customers to WordPress accounts made making the menu system workable. For the front page, I created a fake WordPress custom menu and upon login, the menu system was replaced with a live custom menu, which I talk about here.

Written by Travis Smith · Categorized: Plugins, Tutorials

Mar 29 2011

How to Make My Own Genesis Child Theme Sidebar Available and Not the Default Primary and Secondary Sidebars

So if you want to make the two original sidebars unavailable, you first need to unregister those sidebars. To do this, add the following to your functions.php file.
[php]//Unregister Sidebars
unregister_sidebar('sidebar');
unregister_sidebar('sidebar-alt');

// Remove Default Genesis Sidebar
remove_action('genesis_sidebar', 'genesis_do_sidebar'); [/php]

Then you need to register your new widget area:
[php]add_action('genesis_sidebar', 'child_do_sidebar');
function child_do_sidebar() { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Child Sidebar') ){ ?><?php } ?>
<?php }
[/php]

Then add your Child Sidebar:
[php]// Add Child Sidebar
genesis_register_sidebar(array(
'name'=>'Child Sidebar',
'id' => 'sidebar-primary',
'description' => 'This is the primary Child sidebar',
'before_widget' => '<div id="%1$s"><div>',
'after_widget' => "</div></div>n",
'before_title' => '<h4><span>',
'after_title' => "</span></h4>n"
));[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Mar 28 2011

How to Set Post Thumbnail Size for Genesis's Child Themes

This is rather easy. In your functions.php file, add this one line of code.
[php]// Add Post Thumbnail Support
set_post_thumbnail_size(300, 165, TRUE);[/php]

For more information on set_post_thumbnail_size, see the WordPress Codex, but generally speaking here is the usage:
[php]<?php set_post_thumbnail_size( $width, $height, $crop ); ?> [/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Mar 27 2011

How to Add the SubNav or the Secondary Navigation to Certain Pages

Here's how to add the Secondary Navigation to certain pages with the various Genesis options including Fancy Dropdowns, depth, and order. Add this to your functions.php file.

[php]
//just in case: ensures subnav on Genesis Theme Settings is set to true/checked.
$genset=get_option('genesis-settings');
if (!$genset['subnav']) {
$genset['subnav']=1;
update_option('genesis-settings',$genset);
}
//Remove Subnav
remove_action('genesis_after_header', 'genesis_do_subnav');
add_action('genesis_after_header','my_custom_subnav');

function my_custom_subnav () {
$genset['subnav_superfish'] = 1; //1 = Enable Fancy Dropdowns, 0 = Disable
$genset['subnav_home'] = 0; //1 = Display home, 0 = Disable
$genset['subnav_type'] = 'categories'; // pages = List of Pages, categories = List of Categories, nav-menu = Custom Nav Menu
$genset['subnav_pages_sort'] = menu_order; // menu_order = Menu Order, post_title = Title, ID = ID, post_date = Date Created, post_modified = Date Modified, post_author = Author, post_name = Slug
$genset['subnav_categories_sort'] = post-title; // menu_order = Menu Order, post_title = Title, ID = ID, post_date = Date Created, post_modified = Date Modified, post_author = Author, post_name = Slug
$genset['subnav_depth'] = 0; // 0 = No Limit, 1, 2, 3, 4
update_option('genesis-settings',$genset);

$pages = array(1,2,3); //insert whatever page ids, slugs etc.
if (is_page($pages)) {
genesis_do_subnav();
}
}[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Mar 26 2011

How to Unregister or Remove the Secondary Sidebar

Ever get the question, "I placed my widget in the sidebar but it doesn't appear! Why!?" only to discover that they moved the item to the Secondary Sidebar. How about just removing that sidebar altogether? Here's how:

[php]unregister_sidebar('sidebar-alt');[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

  • « Previous Page
  • 1
  • …
  • 46
  • 47
  • 48
  • 49
  • 50
  • …
  • 61
  • Next Page »
  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in