Hi,
I am using QuickRise (Themeforest)
I tried <?php fs_list_pages('exclude=31,57'); ?>
but It blew up ALL pages from the menu.
I took a look at the function.php and I dont know what to do.
The code is this:
<?php
include("settings.php");
# Displays language
function fs_lang($key, $echo=true) {
include(dirname(__FILE__).'/language/' . fs_settings('language') . '.php');
if ($echo) echo $lang[$key];
else return $lang[$key];
}
# WIDGET: Top Sidebar
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => fs_lang("Top Sidebar", false),
'before_title' => '<h2>',
'after_title' => '</h2>',
'before_widget' => '<div class="box">',
'after_widget' => '</div>',
));
# WIDGET: Left Sidebar
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => fs_lang("Left Sidebar", false),
'before_title' => '<h2>',
'after_title' => '</h2>',
'before_widget' => '<div class="box">',
'after_widget' => '</div>',
));
# WIDGET: Right Sidebar
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => fs_lang("Right Sidebar", false),
'before_title' => '<h2>',
'after_title' => '</h2>',
'before_widget' => '<div class="box">',
'after_widget' => '</div>',
));
# Displays a list of pages
$fs_first = true;
function fs_list_pages($parent=0) {
global $fs_first;
$pages = fs_get_pages($parent);
if (count($pages)>0) {
?><ul><?php
foreach ($pages as $page) {
if ($page->id>0) {
if ($fs_first) {
?><li><a href="<?php echo get_option('home'); ?>"><?php fs_lang('Home'); ?></a><?php
$fs_first = false;
}
?><li<?php if ($count<1) echo ' class="f"'; ?>><a href="<?php echo get_permalink($page->id); ?>"><?php echo $page->title; ?><?php if (fs_has_subpages($page->id)) echo ' »'; ?></a>
<?php $count = fs_list_pages($page->id); ?>
</li><?php
}
}
?></ul><?php
}
$count++;
return $count;
}
# Returns a list of pages
function fs_get_pages($parent=0) {
global $wpdb, $wp_query;
$querystr = "SELECT $wpdb->posts.ID AS <code>id</code>, $wpdb->posts.post_title AS <code>title</code> FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'page' AND $wpdb->posts.post_parent = $parent ORDER BY $wpdb->posts.menu_order, $wpdb->posts.post_title ASC";
$pageposts = $wpdb->get_results($querystr, OBJECT);
return $pageposts;
}
# Determines whether page has children.
function fs_has_subpages($id) {
global $wpdb, $wp_query;
$querystr = "SELECT COUNT($wpdb->posts.ID) AS <code>count</code> FROM $wpdb->posts WHERE $wpdb->posts.post_parent = $id AND $wpdb->posts.post_type = 'page' AND $wpdb->posts.post_status = 'publish'";
$count = $wpdb->get_results($querystr, OBJECT);
return $count[0]->count;
}
# Displays a list of categories
function fs_list_categories($parent=0, $exclude='0') {
$categories = fs_get_categories($parent, $exclude);
if (count($categories)>0) {
?><ul><?php
foreach ($categories as $category) {
if ($category->id>0) {
?><li><a href="<?php echo get_category_link($category->id); ?>"><?php echo $category->name; ?><?php if (fs_has_subcats($category->id)) echo ' »'; ?></a>
<?php fs_list_categories($category->id, $exclude); ?>
</li><?php
}
}
?></ul><?php
}
}
# Returns a list of categories
function fs_get_categories($parent=0, $exclude) {
global $wpdb, $wp_query;
$querystr = "SELECT $wpdb->term_taxonomy.term_id AS <code>id</code>, $wpdb->terms.name FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE $wpdb->term_taxonomy.parent = $parent AND $wpdb->term_taxonomy.taxonomy = 'category' AND $wpdb->term_taxonomy.term_id NOT IN ($exclude) AND $wpdb->term_taxonomy.count > 0 ORDER BY $wpdb->term_taxonomy.term_id";
$categories = $wpdb->get_results($querystr, OBJECT);
return $categories;
}
# Determines whether category has subcategories
function fs_has_subcats($id) {
global $wpdb, $wp_query;
$querystr = "SELECT COUNT($wpdb->term_taxonomy.term_id) AS <code>count</code> FROM $wpdb->term_taxonomy WHERE $wpdb->term_taxonomy.parent = $id";
$count = $wpdb->get_results($querystr, OBJECT);
return $count[0]->count;
}
# Determines whether sub is child of parent
function fs_sub($sub, $parent) {
global $wpdb;
$querystr = "SELECT $wpdb->posts.ID FROM $wpdb->posts WHERE $wpdb->posts.post_parent = $parent";
$subpages = $wpdb->get_results($querystr, OBJECT);
foreach ($subpages as $v) {
if ($sub==$v->ID) return true;
}
return false;
}
# Displays post image attachment (sizes: thumbnail, medium, full)
function fs_attachment_image($postid=0, $size='articleimg', $attributes='') {
if ($postid<1) $postid = get_the_ID();
$custom = get_post_meta($postid, 'articleimg', true);
if (strlen($custom)>0) {
?><img src="<?php echo $custom; ?>" <?php echo $attributes; ?> /><?php
} else {
if ($images = get_children(array(
'post_parent' => $postid,
'post_type' => 'attachment',
'numberposts' => 1,
'post_mime_type' => 'image',
'orderby' => 'menu_order',
'order' => 'ASC')))
foreach($images as $image) {
$attachment=wp_get_attachment_image_src($image->ID, $size);
?><img src="<?php echo $attachment[0]; ?>" <?php echo $attributes; ?> /><?php
}
}
}
# Removes tags and trailing dots from excerpt
function fs_clean($excerpt, $substr=0) {
$string = strip_tags(str_replace('[...]', '...', $excerpt));
if ($substr>0) {
$string = substr($string, 0, $substr);
}
return $string;
}
# Displays the comment authors gravatar if available
function fs_gravatar($size=50, $attributes='', $author_email='') {
global $comment, $settings;
if (fs_settings('gravatar')=='enabled') {
if (empty($author_email)) {
ob_start();
comment_author_email();
$author_email = ob_get_clean();
}
$gravatar_url = 'https://www.gravatar.com/avatar/' . md5(strtolower($author_email)) . '?s=' . $size . '&d=' . fs_settings('gravatar_fallback');
?><img src="<?php echo $gravatar_url; ?>" <?php echo $attributes ?>/><?php
}
}
# Retrieves the setting's value depending on 'key'.
function fs_settings($key) {
global $settings;
return $settings[$key];
}
# Displays a list of popular posts
function fs_popular_posts($num, $pre='<li>', $suf='</li>', $excerpt=true) {
global $wpdb, $post;
$querystr = "SELECT $wpdb->posts.post_title, $wpdb->posts.comment_count, $wpdb->posts.ID, $wpdb->posts.post_content FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'post' ORDER BY $wpdb->posts.comment_count DESC LIMIT $num";
$myposts = $wpdb->get_results($querystr, OBJECT);
foreach($myposts as $post) {
echo $pre;
?>
<?php if (fs_settings('popular_thumb')=='enabled') : ?>
<?php fs_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?>
<?php endif; ?>
<a href="<?php echo get_permalink($post->ID); ?>"><?php the_title(); ?></a>
<p><?php echo fs_clean($post->post_content, 100); ?>...</p>
<?php
echo $suf;
}
}
# Limits text to a certain number of words.
function fs_words($string, $num) {
$matches = array();
if (preg_match("/^(\W*\b\w+\b){1,$num}/", $string,
$matches)) {
$result = trim($matches[0]);
return $result;
}
}
# Show excerpt in number of words
function fs_excerpt($string, $num) {
$string = preg_replace('/\<img .*\/>/', '', $string);
$string = str_replace('<p>', '', $string);
$string = str_replace('</p>', '', $string);
echo trim(fs_words($string, $num));
}
# Comments template
function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
<?php
$comment_type = get_comment_type();
if($comment_type == 'trackback') :
?><p class="trackback"><?php fs_lang("Trackback"); ?>: <?php echo get_comment_author_link() ?></p><?php
else :
?>
<div class="comment1">
<?php echo get_avatar($comment,$size='30'); ?>
<div class="details">
<p class="author"><?php echo get_comment_author_link() ?></p>
<?php if ($comment->comment_approved == '0') : ?>
<p class="mod"><?php fs_lang("Your comment is awaiting moderation."); ?></p>
<?php endif; ?>
<p class="date"><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?> <?php edit_comment_link(__('Edit'),' ','') ?>
</p>
</div>
<div class="commenttext"><?php comment_text() ?></div>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
<?php
endif;
}
# Trackbacks template
function mytheme_ping($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li id="comment-<?php comment_ID() ?>">
<?php echo get_comment_author_link() ?>
<em><?php printf(__('%1$s at %2$s'), get_comment_date('m-d-Y'), get_comment_time()) ?></em>
<?php
}
?>
I appreciate any help.
Thanks!!