latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

RK Creative


My Latest Replies (From Various Topics)

Viewing 2 replies - 26 through 27 (of 27 total)
Author Replies
Author Replies
Posted: Wednesday Apr 18th, 2012 at 12:01 pm #11121

Thanks very much Philly. I am using a custom theme which has a main menu but the functions.php file does not seem standard.

So I’m not sure how to register both menus. If it’s any help here is the contents of my functions.php. Any help would be appreciated.

<?php
	//Load the Lenguage for the theme.
	load_theme_textdomain( 'eneaa', TEMPLATEPATH.'/languages' );

	$locale = get_locale();
	$locale_file = TEMPLATEPATH."/languages/$locale.php";
	if ( is_readable($locale_file) )
		require_once($locale_file);
	//--------------------------------
		

	// Add RSS links to <head> section
	//automatic_feed_links();
	
	// Load jQuery
	
	if ( !is_admin() ) {
	   wp_deregister_script('jquery');
	   wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"), false);
	   wp_enqueue_script('jquery');
	}
	
	
	
	

	
	// Clean up the <head>
	// remove some WP defaults
	function removeHeadLinks() {
		// remove simple discovery link
		remove_action('wp_head', 'rsd_link');
		// remove windows live writer link
		remove_action('wp_head', 'wlwmanifest_link');
		// remove the version number
		remove_action('wp_head', 'wp_generator');
		// remove header links
	}
	add_action('init', 'removeHeadLinks');
	// Add RSS links to <head> section
	add_theme_support('automatic-feed-links');
	
	
	
	//Custom Comments
	require_once (TEMPLATEPATH . "/framework/custom-comments.php");
	
	
	
	
	//Add Menu Manager---------------------------
	add_theme_support( 'nav-menus' );
	add_action( 'init', 'register_my_menus' );
	function register_my_menus() {
	register_nav_menus(
	array(
	'menu-1' => __( 'Navigation Menu' )
		)
					);
	}
	//End Menu Manager---------------------------
    


	
	//Widgets Areas
	require_once (TEMPLATEPATH . "/framework/widgets-areas.php");
	
	//Custom Styles from Admin Panel
	require_once (TEMPLATEPATH . "/framework/theme_scripts/styles.php");
	
	//Custom Widgets
	require_once (TEMPLATEPATH . "/framework/widgets/social-share-widget.php");
	require_once (TEMPLATEPATH . "/framework/widgets/related-posts.php");
	require_once (TEMPLATEPATH . "/framework/widgets/social.php");
	require_once (TEMPLATEPATH . "/framework/widgets/contact-info.php");
	require_once (TEMPLATEPATH . "/framework/widgets/quick-contact.php");
	require_once (TEMPLATEPATH . "/framework/widgets/twitter-widget.php");
	require_once (TEMPLATEPATH . "/framework/widgets/advertisement_125.php");
	//require_once (TEMPLATEPATH . "/framework/widgets/about_author_widget.php");
	require_once (TEMPLATEPATH . "/framework/widgets/most-popular.php");
	//require_once (TEMPLATEPATH . "/framework/widgets/testimonials.php");
	require_once (TEMPLATEPATH . "/framework/widgets/tags.php");
	require_once (TEMPLATEPATH . "/framework/widgets/suscribe_twitter_btn.php");
	
	//Sidebar Generator
	require_once (TEMPLATEPATH . "/framework/portfolio_generator.php");
	
	//Custom Posts Types
	require_once (TEMPLATEPATH . "/framework/post_types/slider-post-types.php");
	require_once (TEMPLATEPATH . "/framework/post_types/portfolio-post-types.php");
	
	
	
	//Breadcrumbs
	require_once (TEMPLATEPATH . "/framework/breadcrumbs.php");
	
	//Theme Pagination
	require_once (TEMPLATEPATH . "/framework/pagination.php");
	
	
	
	//Sidebar Generator
	require_once (TEMPLATEPATH . "/framework/sidebar_generator.php");
	
	
	
	//Set the Full Width Image value
	if ( ! isset( $content_width ) ) $content_width = 900;
	
	
	
function excerpt($num) {
$limit = $num+1;
$excerpt = explode(' ', get_the_excerpt(), $limit);
array_pop($excerpt);
$excerpt = implode(" ",$excerpt)."...";
return $excerpt;
}

function content($limit) {
  $content = explode(' ', get_the_content(), $limit);
  if (count($content)>=$limit) {
    array_pop($content);
    $content = implode(" ",$content).'...';
  } else {
    $content = implode(" ",$content);
  }	
  $content = preg_replace('/\[.+\]/','', $content);
  $content = apply_filters('the_content', $content); 
  $content = str_replace(']]>', ']]&gt;', $content);
  return $content;
}


//Function to retrive the image when are uploaded with a Meta Box
function get_meta_image($post_id, $field) {
				 global $wpdb;
				 $query = "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'attachment' AND post_parent = %d";
				 return $wpdb->get_col($wpdb->prepare($query,$post_id));
}



	





	




/*-----------------------------------------------------------------------------------*/
/* Options Framework Functions
/*-----------------------------------------------------------------------------------*/

/* Set the file path based on whether the Options Framework is in a parent theme or child theme */

if ( STYLESHEETPATH == TEMPLATEPATH ) {
	define('OF_FILEPATH', TEMPLATEPATH);
	define('OF_DIRECTORY', get_template_directory_uri()."/framework");
} else {
	define('OF_FILEPATH', STYLESHEETPATH);
	define('OF_DIRECTORY', get_template_directory_uri()."/framework");
}

/* These files build out the options interface.  Likely won't need to edit these. */

require_once (OF_FILEPATH . '/framework/admin/admin-functions.php');		// Custom functions and plugins
require_once (OF_FILEPATH . '/framework/admin/admin-interface.php');		// Admin Interfaces (options,framework, seo)

/* These files build out the theme specific options and associated functions. */

require_once (OF_FILEPATH . '/framework/admin/theme-options.php'); 	// Options panel settings and custom settings
require_once (OF_FILEPATH . '/framework/admin/theme-functions.php'); 	// Theme actions based on options settings
/*-----------------------------------------------------------------------------------*/

	
	
	
	
	
//Shortcodes
require_once (OF_FILEPATH . '/framework/shortcodes/columns.php'); //Columns
require_once (OF_FILEPATH . '/framework/shortcodes/lightbox.php'); //Lightbox
require_once (OF_FILEPATH . '/framework/shortcodes/video.php'); //Video
require_once (OF_FILEPATH . '/framework/shortcodes/typography.php'); //Typography
require_once (OF_FILEPATH . '/framework/shortcodes/buttons.php'); //Buttons
require_once (OF_FILEPATH . '/framework/shortcodes/cool_buttons.php'); //Buttons
require_once (OF_FILEPATH . '/framework/shortcodes/tabs.php'); //Tabs
require_once (OF_FILEPATH . '/framework/shortcodes/frames.php'); //Frames
require_once (OF_FILEPATH . '/framework/shortcodes/boxes.php'); //Boxes
require_once (OF_FILEPATH . '/framework/shortcodes/map.php'); //Map
require_once (OF_FILEPATH . '/framework/shortcodes/form.php'); //Form
require_once (OF_FILEPATH . '/framework/shortcodes/slogan.php'); //Slogan
require_once (OF_FILEPATH . '/framework/shortcodes/icon.php'); //Icon
require_once (OF_FILEPATH . '/framework/shortcodes/space_divider.php'); //Space Divider
require_once (OF_FILEPATH . '/framework/shortcodes/toggle.php'); //Toggle
require_once (OF_FILEPATH . '/framework/shortcodes/divider.php'); //Divider
require_once (OF_FILEPATH . '/framework/shortcodes/testimonials.php'); //testimonials
require_once (OF_FILEPATH . '/framework/shortcodes/sliding.php'); //testimonials



//Meta Boxes
require_once (OF_FILEPATH . '/framework/meta_boxes/meta-box.php');
require_once (OF_FILEPATH . '/framework//meta_boxes/meta-box-usage.php');
	
	

//Long posts should require a higher limit, see http://core.trac.wordpress.org/ticket/8553
@ini_set('pcre.backtrack_limit', 500000);

//Cufon Functions
require_once (OF_FILEPATH . '/framework/cufon_functions.php'); 

?>
Posted: Wednesday Apr 18th, 2012 at 9:43 am #11108

Thank you for pointing me to shortcode conditionals.

My question is about how to get s2 to manage the wp main menu.

See your own s2 website. Look at the main menu. I am trying to replicate similar conditional functionality using the main menu.

How can I get s2 to manage the main menu items conditional on user’s login status ?

if user is already logged in > hide registration link
if user is already logged in > show profile link

if user is not logged in > show login link

Viewing 2 replies - 26 through 27 (of 27 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.