Generate wordpress Sub Menu

<?php  
	
	//default show subnav yes
	if(!isset($showSubnav)) {
		$showSubnav = 1;
	}

	// get the current pageID
	$pageID = $post->ID;
	
	// From the pageID, find the id of it's root page
	if ($post->post_parent)	{
		// There is a parent so get the ancestors
		$ancestors=get_post_ancestors($post->ID);
		$root=count($ancestors)-1;
		$rootParentID = $ancestors[$root];
	} else {
		// otherwise current page is root page
		$rootParentID = $post->ID;
	}
	
	//get page title of root page
	$rootPageName = get_page_name($rootParentID);

	//get child page list of current page 	 
	$pageList = get_page_list($post);

	// if the page list returns no results then don't show it.
	if ( $pageList == "") {
		$showSubnav = 0;
	}
?>

<?php 
	// by default show the subnav. If not then just...
0 comments

Add Jetpack Sharing manually

<?php
	$share_url=get_permalink();
 
	//jetpack social media options
	if ($_SERVER["SERVER_NAME"] != "localhost" && function_exists( 'sharing_display' ) ) {
		//remove automatic sharing_display
		remove_filter( 'the_content', 'sharing_display', 19 );
		remove_filter( 'the_excerpt', 'sharing_display', 19 );
	
		$tempPostID = $post;
		$post = $npost;
		
		//add sharing display manually
		echo sharing_display();
		
		$post = $tempPostID;
	}	
?>
  

0 comments

Add divider between menu items

<div id="nav">
<ul>
	<li><a href="#link">Link 1<img class="dot" src="images/nav_dot.png" alt="" /></a></li>
	<li><a href="#link">Link 2<img class="dot" src="images/nav_dot.png" alt="" /></a></li>
</ul>
</div>
<style>
     #nav ul>:last-child .dot
	{
	  display:none;
	} 
</style>

Another easy Way

<div id="header">
			 
			<?php 
				//filter the main nav menu
				function home_page_menu_args( $args ) {
					global $wpdb;
					$main_nav_sql="SELECT id
									FROM $wpdb->posts
									WHERE post_type = 'page'
									AND post_status =...
0 comments
SET NOCOUNT ON 

DBCC UPDATEUSAGE(0) 

-- DB size.
EXEC sp_spaceused

-- Table row counts and sizes.
CREATE TABLE #t
(
    [name] NVARCHAR(128),
    [rows] CHAR(11),
    reserved VARCHAR(18),
    data VARCHAR(18),
    index_size VARCHAR(18),
    unused VARCHAR(18)
) 

INSERT #t EXEC sp_msForEachTable 'EXEC sp_spaceused ''?''' 

SELECT *
FROM   #t

-- # of rows.
SELECT SUM(CAST([rows] AS int)) AS [rows]
FROM   #t

DROP TABLE #t

Information from wonderful Alexander:

http://therightstuff.de/CommentView,guid,df930155-f60f-4f56-ab33-f1352ff091a1.aspx


0 comments