Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* default search form
*/
?>
<form role="search" method="get" id="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div class="search-wrap">
<label class="screen-reader-text" for="s"><?php _e( 'Search for:', 'presentation' ); ?></label>
<input type="search" placeholder="<?php echo esc_attr( 'Search…', 'presentation' ); ?>" name="s" id="search-input" value="<?php echo esc_attr( get_search_query() ); ?>" />
<input class="screen-reader-text" type="submit" id="search-submit" value="Search" />
@ibmgh
ibmgh / wp2jkimport
Created October 24, 2017 10:25
WordPress to Jekyllrb Import From http://import.jekyllrb.com/docs/wordpress/
$ ruby -rubygems -e 'require "jekyll-import";
JekyllImport::Importers::WordPress.run({
"dbname" => "",
"user" => "",
"password" => "",
"host" => "localhost",
"port" => "3306",
"socket" => "",
"table_prefix" => "wp_",
"site_prefix" => "",
@ibmgh
ibmgh / verticlerule_css
Last active October 23, 2017 22:45
Vertical Rule at side
for this you basically need to setup a place to put it and a div statement works.
<div style="width:150px;height:2px;background-color:#000000;">&nbsp;</div>
this could also be referenced:
.hr {width:150px;height:2px;background-color:#000000;} // in your css file/script
<div class="hr">&nbsp;</div> <!-- IN HTML -->
You can change the position and have it going up/down or left/right with css placement and z-index
@ibmgh
ibmgh / simplecollapsible
Created October 20, 2017 17:19
Bootstrap Collapsible Accordion
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
@ibmgh
ibmgh / Nav collapsible.html
Created October 14, 2017 18:59
Bootstrap Nav bar collapsible Example
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
@ibmgh
ibmgh / reg-post-type
Created October 4, 2017 10:43
Register post type WordPress From https://generatewp.com/post-type/
// Register Custom Post Type
function custom_post_type() {
$labels = array(
'name' => _x( 'Post Types', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Post Type', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Post Types', 'text_domain' ),
'name_admin_bar' => __( 'Post Type', 'text_domain' ),
'archives' => __( 'Item Archives', 'text_domain' ),
'attributes' => __( 'Item Attributes', 'text_domain' ),
@ibmgh
ibmgh / cpt-query
Created October 4, 2017 10:32
WordPress custom posts type query in a template From https://codex.wordpress.org/Post_Types
$args = array( 'post_type' => 'product', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
echo '<div class="entry-content">';
the_content();
echo '</div>';
endwhile;
//The call to wp_get_current_user() return WP_User object.
<?php
$current_user = wp_get_current_user();
/**
* @example Safe usage: $current_user = wp_get_current_user();
* if ( !($current_user instanceof WP_User) )
* return;
*/
echo 'Username: ' . $current_user->user_login . '<br />';