WP – Redirect to home page after successful login

So I needed a front-end login page that redirects you to the homepage after a successful login. Using the default WP login form, you only need to supply the ‘$args’ needed to redirect after the login. See code below. <!– wp_login_form() is located in wp-includes/general-template.php. Line 470 –> <?php $args = array( ‘redirect’ => ([…]

Youtube API video player with some options

Needed a video player that could disappear after the video finished. So after some Google’ing and Stackoverflow research, I went with Youtube API. <!– Where the Video is placed –><div id=”VideoHolder”> <div id=”player2″></div></div> <!– JS Code in the footer –><!– Start Video –><script src=”http://www.youtube.com/player_api”></script> <script>        // create youtube player       […]

Some WordPress snippets to speed up the Dev process

WP Snippets:1. List all taxonomies( Categories or other you created) 1.1 Normal Loop for Posts – Categories <?php $args = array(  ‘orderby’ => ‘name’  ); $categories = get_categories( $args ); foreach ( $categories as $category ) { echo ‘<span class=”areaMap”><a href=”‘ . get_category_link( $category->term_id ) . ‘”>’ . $category->name . ‘</a><img class=”orangeArrow” src=”‘. get_template_directory_uri() .[…]

WordPress: Custom Code snippets

Custom Social share:<div class=”socialBG”> <a href=”http://www.facebook.com/sharer/sharer.php?u=<?php echo get_site_url(); ?>/<?php echo $slug = basename(get_permalink());?>” class=”FB” target=”_blank”> </a> <a href=”http://twitter.com/intent/tweet?text=<?php echo get_site_url(); ?>/<?php echo $slug = basename(get_permalink());?>” class=”tw” target=”_blank”> </a> <a href=”http://pinterest.com/pin/create/button/?url=<?php echo get_site_url(); ?>/<?php echo $slug = basename(get_permalink());?>&media=<?php echo $url; ?>&description=<?php echo the_title() ?>” class=”pin-it-button” count-layout=”horizontal” target=”_blank”> </a><a href=”mailto:mail@domain.com?subject=word+word+word+word&body=<?php echo the_title()?>: <?php echo get_permalink() ?>”> <img[…]

Get WordPress Single Post Comments in loop.

I was working on a WordPress site that seemed to not want to pull in the single post comments, so I had to hard code it in somehow. Did a little search and came across this: http://wordpress.stackexchange.com/questions/3141/getting-post-comments-for-post-id-using-wp-query-and-a-custom-loop – See Talha’s comment at the bottom. Thanks dude 🙂 His solution: $comments = get_comments(‘post_id=’.$post->ID); foreach($comments as $comment) : print_r($comment); endforeach;[…]