WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Mar 13 2012

Genesis March Madness: College Basketball Pick'em Tourney

So, just a LATE shot in the dark and not sure if anyone will sign up, I created a March Madness Tourney Bracket on Yahoo! (yes, I am sorry that Google hasn't created such apps yet...).

Anyways, here's the Bracket SCORING:
Yahoo! Tourney Pick'em

  • Round of 64: 1pt
  • Round of 32: 2pts
  • Sweet 16/Reg. Semis: 4pts
  • Elite 8/Reg. Finals: 6pts
  • Final Four/Semifinals: 10pts
  • Final/Championship: 16pts

Bonus Points = Seed differiential for UPSETS!! Seed diference multipliers put heavy emphasis on big upsets in early rounds.

Signup here
Password: genesiswp

Written by Travis Smith · Categorized: WordPress

Mar 13 2012

Get Genesis Comments in a Shortcode

Recently, I corresponded with someone who need to port the Genesis comments into a shortcode for a custom post type template (I'm assuming). However, doing it seemed challenging and a lot of hack work, but he reminded me of the genesis template part, which made it very doable.

Since I thought this was fairly novel idea, I thought I'd post about here.

[php]
remove_action( 'genesis_after_post', 'genesis_get_comments_template' );

function ts_genesis_comments_shortcode() {
ob_start();
genesis_get_comments_template();
$tsComments = ob_get_clean();
return $tsComments;
}
add_shortcode ('ts-genesis-comments', 'ts_genesis_comments_shortcode');
[/php]

First we need to remove the comments template via remove_action( 'genesis_after_post', 'genesis_get_comments_template' );. Then we can get the comments via output buffering (ob_start() and ob_get_clean()).

Written by Travis Smith · Categorized: Genesis

Mar 12 2012

[Infographic] Pagely WordPress Top40

Pagely WordPress Top40
Pagely WordPress Top40 Click for Larger Image

Written by Travis Smith · Categorized: Infographic, WordPress

Mar 05 2012

How to Move the Comment Form Above the Comments List in Genesis

This is extremely easy and only involves only a few lines of code that can go into functions.php.

[php]
add_action( 'genesis_before_comments' , 'wps_post_type_check' );
function wps_post_type_check () {
if ( is_single() ) {
if ( have_comments() ) {
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' );
add_action( 'genesis_list_comments', 'genesis_do_comment_form' , 5 );
}
}
}
[/php]

If you do not check for comments, then simply removing the form and adding it at the top of the list will remove the form altogether on single pages/posts that have no comments. We do this with a simple function, have_comments().

Written by Travis Smith · Categorized: Genesis

Mar 05 2012

How to Embed Videos at Different Sizes in Genesis (and other Themes)

Need to embed videos but hate the limitation that you cannot have the same post appear with the same video on different sizes? WordPress provides a little known filter (embed_defaults) that will enable you to easily change the height and width of an embeded object.


Currently, WordPress allows oEmbed by default, and it supports the following sites:

  • YouTube (only public videos and playlists - "unlisted" and "private" videos will not embed)
  • Vimeo
  • DailyMotion
  • blip.tv
  • Flickr (both videos and images)
  • Viddler
  • Hulu
  • Qik
  • Revision3
  • Scribd
  • Photobucket
  • PollDaddy
  • WordPress.tv (only VideoPress-type videos for the time being)
  • SmugMug (WordPress 3.0+)
  • FunnyOrDie.com (WordPress 3.0+)
  • Twitter (WordPress 3.4+)

For any of these videos, you can support multiple widths so that the video is "full" content width. For example, check out these examples:

  • Video on my site on full-width
  • Video on my site on sidebar-content-sidebar
  • Video on my site on sidebar-content

So how did I do this? In HTML mode, I inserted the url

http://www.youtube.com/watch?v=R2a8TRSgzZY

and clicked publish. Then in my functions.php file, I have this code:

*NOTE: In Genesis 1.8, this function will break the blog page template due to a bug that will hopefully be fixed in the next version.

In this function, we are filtering a WordPress function wp_embed_defaults() that creates default array of embed parameters when do_shortcode is used (which is applied to the_content).

For other themes, the code would be modified to use the standard WordPress conditionals.

Written by Travis Smith · Categorized: Genesis

  • « Previous Page
  • 1
  • …
  • 22
  • 23
  • 24
  • 25
  • 26
  • …
  • 61
  • Next Page »
  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

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