本文整理匯總了PHP中mfn_ID函數的典型用法代碼示例。如果您正苦於以下問題:PHP mfn_ID函數的具體用法?PHP mfn_ID怎麽用?PHP mfn_ID使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了mfn_ID函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: mfn_wp_nav_menu
function mfn_wp_nav_menu()
{
$args = array('container' => 'nav', 'container_id' => 'menu', 'menu_class' => 'menu', 'fallback_cb' => 'mfn_wp_page_menu', 'depth' => 3, 'link_before' => '<span>', 'link_after' => '</span>', 'walker' => new Walker_Nav_Menu_Mfn());
// custom menu for pages
if ($custom_menu = get_post_meta(mfn_ID(), 'mfn-post-menu', true)) {
$args['menu'] = $custom_menu;
} else {
$args['theme_location'] = 'main-menu';
}
wp_nav_menu($args);
}
示例2: mfn_wp_nav_menu
function mfn_wp_nav_menu()
{
$args = array('container' => 'nav', 'container_id' => 'menu', 'menu_class' => 'menu', 'fallback_cb' => 'mfn_wp_page_menu', 'depth' => 5, 'link_before' => '<span>', 'link_after' => '</span>');
// custom walker for mega menu
$theme_disable = mfn_opts_get('theme-disable');
if (!isset($theme_disable['mega-menu'])) {
$args['walker'] = new Walker_Nav_Menu_Mfn();
}
// custom menu for pages
if ($custom_menu = get_post_meta(mfn_ID(), 'mfn-post-menu', true)) {
$args['menu'] = $custom_menu;
} else {
$args['theme_location'] = 'main-menu';
}
wp_nav_menu($args);
}
示例3: mfn_wp_nav_menu
function mfn_wp_nav_menu()
{
$args = array('container' => 'nav', 'container_id' => 'menu', 'menu_class' => 'menu', 'fallback_cb' => 'mfn_wp_page_menu', 'depth' => 5, 'link_before' => '<span>', 'link_after' => '</span>');
// Mega Menu | Custom Walker
$theme_disable = mfn_opts_get('theme-disable');
if (!isset($theme_disable['mega-menu'])) {
$args['walker'] = new Walker_Nav_Menu_Mfn();
}
// Custom Menu
if (mfn_ID() && is_single() && get_post_type() == 'post' && ($custom_menu = mfn_opts_get('blog-single-menu'))) {
// Theme Options | Single Posts
$args['menu'] = $custom_menu;
} elseif (mfn_ID() && is_single() && get_post_type() == 'portfolio' && ($custom_menu = mfn_opts_get('portfolio-single-menu'))) {
// Theme Options | Single Portfolio
$args['menu'] = $custom_menu;
} elseif ($custom_menu = get_post_meta(mfn_ID(), 'mfn-post-menu', true)) {
// Page Options | Page
$args['menu'] = $custom_menu;
} else {
// Default
$args['theme_location'] = 'main-menu';
}
wp_nav_menu($args);
}
示例4: mfn_body_classes
function mfn_body_classes($classes)
{
// Layout | Custom ------------------------------------
$layoutID = mfn_layout_ID();
// Slider ---------------------------------------------
if (mfn_slider()) {
$classes[] = 'template-slider';
}
// Sidebar --------------------------------------------
$classes[] = mfn_sidebar_classes();
// Skin -----------------------------------------------
if ($_GET && key_exists('mfn-c', $_GET)) {
$classes[] = 'color-' . $_GET['mfn-c'];
// demo
} elseif ($layoutID) {
$classes[] = 'color-' . get_post_meta($layoutID, 'mfn-post-skin', true);
} else {
$classes[] = 'color-' . mfn_opts_get('skin', 'custom');
}
// Style | Default & Simple ---------------------------
if ($_GET && key_exists('mfn-style', $_GET)) {
$classes[] = 'style-' . $_GET['mfn-style'];
// demo
} else {
$classes[] = 'style-' . mfn_opts_get('style', 'default');
}
// Layout | Full Width & Boxed ------------------------
if ($_GET && key_exists('mfn-box', $_GET)) {
$classes[] = 'layout-boxed';
// demo
} elseif ($layoutID) {
$classes[] = 'layout-' . get_post_meta($layoutID, 'mfn-post-layout', true);
} else {
$classes[] = 'layout-' . mfn_opts_get('layout', 'full-width');
}
// One Page -------------------------------------------
if (get_post_meta(mfn_ID(), 'mfn-post-one-page', true)) {
$classes[] = 'one-page';
}
// Grid 960px -----------------------------------------
if (mfn_is_960()) {
$classes[] = 'grid960';
}
// Nice Scroll ----------------------------------------
if (mfn_opts_get('nice-scroll')) {
$classes[] = 'nice-scroll-on';
}
// Responsive -----------------------------------------
if (mfn_opts_get('no-hover')) {
$classes[] = 'no-hover-' . mfn_opts_get('no-hover');
}
if (mfn_opts_get('no-section-bg')) {
$classes[] = 'no-section-bg-' . mfn_opts_get('no-section-bg');
}
if (mfn_opts_get('responsive-top-bar')) {
$classes[] = 'mobile-tb-' . mfn_opts_get('responsive-top-bar');
}
$responsive_options = mfn_opts_get('responsive-options');
if (is_array($responsive_options) && isset($responsive_options['mobile-wide'])) {
$classes[] = 'mobile-wide';
}
// Button | Style -------------------------------------
if ($_GET && key_exists('mfn-btn', $_GET)) {
$classes[] = 'button-' . $_GET['mfn-btn'];
// demo
} elseif (mfn_opts_get('button-style')) {
$classes[] = 'button-' . mfn_opts_get('button-style');
}
// Image Frame | Style --------------------------------
if ($_GET && key_exists('mfn-if', $_GET)) {
$classes[] = 'if-' . $_GET['mfn-if'];
// demo
} elseif (mfn_opts_get('image-frame-style')) {
$classes[] = 'if-' . mfn_opts_get('image-frame-style');
}
// Content Padding ------------------------------------
if (mfn_opts_get('content-remove-padding')) {
$classes[] = 'no-content-padding';
} elseif (get_post_meta(mfn_ID(), 'mfn-post-remove-padding', true)) {
$classes[] = 'no-content-padding';
}
// RTL | demo only ------------------------------------
if ($_GET && key_exists('mfn-rtl', $_GET)) {
$classes[] = 'rtl';
}
// Love -----------------------------------------------
if (!mfn_opts_get('love')) {
$classes[] = 'hide-love';
}
// Table Hover ----------------------------------------
if (mfn_opts_get('table-hover-disable')) {
$classes[] = 'no-table-hover';
}
// Header =============================================
$header_options = mfn_opts_get('header-fw') ? mfn_opts_get('header-fw') : false;
// Header | Layout --------------------------
$classes[] = mfn_header_style();
// Header | Full Width ----------------------
if ($_GET && key_exists('mfn-hfw', $_GET)) {
$classes[] = 'header-fw';
//.........這裏部分代碼省略.........
示例5: get_permalink
?>
</li>
<li class="categories"><a class="open" href="#"><i class="icon-docs"></i><?php
echo $translate['categories'];
?>
<i class="icon-down-dir"></i></a></li>
<li class="tags"><a class="open" href="#"><i class="icon-tag"></i><?php
echo $translate['tags'];
?>
<i class="icon-down-dir"></i></a></li>
<li class="authors"><a class="open" href="#"><i class="icon-user"></i><?php
echo $translate['authors'];
?>
<i class="icon-down-dir"></i></a></li>
<li class="reset"><a class="close" data-rel="*" href="<?php
echo get_permalink(mfn_ID());
?>
"><i class="icon-cancel"></i><?php
echo $translate['all'];
?>
</a></li>
</ul>
<div class="filters_wrapper">
<ul class="categories">
<?php
if ($categories = get_categories()) {
foreach ($categories as $category) {
echo '<li><a data-rel=".category-' . $category->slug . '" href="' . get_term_link($category) . '">' . $category->name . '</a></li>';
}
}
示例6: mfn_breadcrumbs
//.........這裏部分代碼省略.........
}
// Plugin | Events Calendar -------------------------------------------
if (function_exists('tribe_is_month') && (tribe_is_event_query() || tribe_is_month() || tribe_is_event() || tribe_is_day() || tribe_is_venue())) {
if (function_exists('tribe_get_events_link')) {
$breadcrumbs[] = '<a href="' . tribe_get_events_link() . '">' . tribe_get_events_title() . '</a>';
}
} elseif (is_front_page() || is_home()) {
// do nothing
// Blog | Tag -------------------------------------
} elseif (is_tag()) {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . single_tag_title('', false) . '</a>';
// Blog | Category --------------------------------
} elseif (is_category()) {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . single_cat_title('', false) . '</a>';
// Blog | Author ----------------------------------
} elseif (is_author()) {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_author() . '</a>';
// Blog | Day -------------------------------------
} elseif (is_day()) {
$breadcrumbs[] = '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a>';
$breadcrumbs[] = '<a href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . get_the_time('F') . '</a>';
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_time('d') . '</a>';
// Blog | Month -----------------------------------
} elseif (is_month()) {
$breadcrumbs[] = '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a>';
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_time('F') . '</a>';
// Blog | Year ------------------------------------
} elseif (is_year()) {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_time('Y') . '</a>';
// Single -----------------------------------------
} elseif (is_single() && !is_attachment()) {
// Custom Post Type -----------------
if (get_post_type() != 'post') {
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
$portfolio_page_id = mfn_wpml_ID(mfn_opts_get('portfolio-page'));
// Portfolio Page ------------
if ($slug['slug'] == mfn_opts_get('portfolio-slug', 'portfolio-item') && $portfolio_page_id) {
$breadcrumbs[] = '<a href="' . get_page_link($portfolio_page_id) . '">' . get_the_title($portfolio_page_id) . '</a>';
}
// Category ----------
if ($portfolio_page_id) {
$terms = get_the_terms(get_the_ID(), 'portfolio-types');
if (!empty($terms) && !is_wp_error($terms)) {
$term = $terms[0];
$breadcrumbs[] = '<a href="' . get_term_link($term) . '">' . $term->name . '</a>';
}
}
// Single Item --------
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_title() . '</a>';
// Blog | Single --------------------
} else {
$cat = get_the_category();
if (!empty($cat)) {
$breadcrumbs[] = get_category_parents($cat[0], true, $separator);
}
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_title() . '</a>';
}
// Taxonomy ---------------------------------------
} elseif (!is_page() && get_post_taxonomies()) {
// Portfolio ------------------------
$post_type = get_post_type_object(get_post_type());
if ($post_type->name == 'portfolio' && ($portfolio_page_id = mfn_wpml_ID(mfn_opts_get('portfolio-page')))) {
$breadcrumbs[] = '<a href="' . get_page_link($portfolio_page_id) . '">' . get_the_title($portfolio_page_id) . '</a>';
}
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . single_cat_title('', false) . '</a>';
// Page with parent -------------------------------
} elseif (is_page() && $post->post_parent) {
$parent_id = $post->post_parent;
$parents = array();
while ($parent_id) {
$page = get_page($parent_id);
$parents[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
$parent_id = $page->post_parent;
}
$parents = array_reverse($parents);
$breadcrumbs = array_merge_recursive($breadcrumbs, $parents);
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_title(mfn_ID()) . '</a>';
// Default ----------------------------------------
} else {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_title(mfn_ID()) . '</a>';
}
// PRINT ------------------------------------------------------------------
echo '<ul class="breadcrumbs ' . $class . '">';
$count = count($breadcrumbs);
$i = 1;
foreach ($breadcrumbs as $bk => $bc) {
if (strpos($bc, $separator)) {
// Category parents fix
echo '<li>' . $bc . '</li>';
} else {
if ($i == $count) {
$separator = '';
}
echo '<li>' . $bc . $separator . '</li>';
}
$i++;
}
echo '</ul>';
}
示例7: mfn_opts_get
* The Page Sidebar containing the widget area.
*
* @package Betheme
* @author Muffin group
* @link http://muffingroup.com
*/
$sidebars = mfn_opts_get('sidebars');
if (get_post_type() == 'page' && mfn_opts_get('single-page-sidebar')) {
// Theme Options | Page
$sidebar = trim(mfn_opts_get('single-page-sidebar'));
} elseif (get_post_type() == 'post' && is_single() && mfn_opts_get('single-sidebar')) {
// Theme Options | Single Post
$sidebar = trim(mfn_opts_get('single-sidebar'));
} else {
// Post Meta
$sidebar = get_post_meta(mfn_ID(), 'mfn-post-sidebar', true);
if ($sidebar || $sidebar === '0') {
$sidebar = $sidebars[$sidebar];
}
}
if ($_GET && key_exists('mfn-s', $_GET)) {
$sidebar = $_GET['mfn-s'];
}
// demo
?>
<?php
if (mfn_sidebar_classes()) {
?>
<div class="four columns">
<div class="widget-area clearfix <?php
示例8: mfn_body_classes
function mfn_body_classes($classes)
{
// custom layout ------------------
$layoutID = get_post_meta(mfn_ID(), 'mfn-post-custom-layout', true);
// template-slider ----------------
if (mfn_slider()) {
$classes[] = 'template-slider';
}
// sidebar classes ----------------
$classes[] = mfn_sidebar_classes();
// skin ---------------------------
if ($_GET && key_exists('mfn-c', $_GET)) {
$classes[] = 'color-' . $_GET['mfn-c'];
// demo
} elseif ($layoutID) {
$classes[] = 'color-' . get_post_meta($layoutID, 'mfn-post-skin', true);
} else {
$classes[] = 'color-' . mfn_opts_get('skin', 'custom');
}
// theme layout -------------------
if ($_GET && key_exists('mfn-box', $_GET)) {
$classes[] = 'layout-boxed';
// demo
} elseif ($layoutID) {
$classes[] = 'layout-' . get_post_meta($layoutID, 'mfn-post-layout', true);
} else {
$classes[] = 'layout-' . mfn_opts_get('layout', 'full-width');
}
// header layout ------------------
$classes[] = mfn_header_style();
// minimalist header --------------
if ($_GET && key_exists('mfn-min', $_GET)) {
$classes[] = 'minimalist-header';
// demo
} elseif ($layoutID) {
if (get_post_meta($layoutID, 'mfn-post-minimalist-header', true)) {
$classes[] = 'minimalist-header';
}
} elseif (mfn_opts_get('minimalist-header')) {
$classes[] = 'minimalist-header';
}
// subheader-transparent ----------
if ($_GET && key_exists('mfn-subtr', $_GET)) {
$classes[] = 'subheader-transparent';
// demo
} elseif (mfn_opts_get('subheader-transparent')) {
$classes[] = 'subheader-transparent';
}
// subheader-transparent ----------
if ($_GET && key_exists('mfn-mr', $_GET)) {
$classes[] = 'header-menu-right';
// demo
} elseif (mfn_opts_get('header-menu-right')) {
$classes[] = 'header-menu-right';
}
// menu-style ---------------------
if ($_GET && key_exists('mfn-m', $_GET)) {
$classes[] = 'menu-' . $_GET['mfn-m'];
// demo
} elseif (mfn_opts_get('menu-style')) {
$classes[] = 'menu-' . mfn_opts_get('menu-style');
}
// grid 960px ---------------------
if (mfn_is_960()) {
$classes[] = 'grid960';
}
// sticky header ------------------
if (mfn_opts_get('sticky-header') && mfn_header_style(true) != 'header-creative') {
$classes[] = 'sticky-header';
}
// nice scroll --------------------
if (mfn_opts_get('nice-scroll')) {
$classes[] = 'nice-scroll-on';
}
// page title ---------------------
if ($_GET && key_exists('mfn-hide', $_GET)) {
$classes[] = 'hide-title-area';
// demo
} elseif (get_post_meta(mfn_ID(), 'mfn-post-hide-title', true)) {
$classes[] = 'hide-title-area';
}
// rtl | demo ---------------------
if ($_GET && key_exists('mfn-rtl', $_GET)) {
$classes[] = 'rtl';
}
return $classes;
}
示例9: elseif
<div id="Top_bar">
<div class="one">
<div class="top_bar_left">
<!-- .logo -->
<div class="logo">
<?php
if (is_front_page()) {
echo '<h1>';
}
// logo - source
if ($_GET && key_exists('mfn-l', $_GET)) {
$logo_src = THEME_URI . '/images/logo/' . $_GET['mfn-l'] . '.png';
// demo
} elseif ($layoutID = get_post_meta(mfn_ID(), 'mfn-post-custom-layout', true)) {
$logo_src = get_post_meta($layoutID, 'mfn-post-logo-img', true);
} else {
$logo_src = mfn_opts_get('logo-img', THEME_URI . '/images/logo/logo.png');
}
// logo - print
echo '<a id="logo" href="' . get_home_url() . '" title="' . get_bloginfo('name') . '">';
echo '<img class="scale-with-grid" src="' . $logo_src . '" alt="' . get_bloginfo('name') . '" />';
echo '</a>';
if (is_front_page()) {
echo '</h1>';
}
?>
</div>
<div class="menu_wrapper">
示例10: mfn_opts_get
$load_more = mfn_opts_get('portfolio-load-more');
$translate['filter'] = mfn_opts_get('translate') ? mfn_opts_get('translate-filter', 'Filter by') : __('Filter by', 'betheme');
$translate['all'] = mfn_opts_get('translate') ? mfn_opts_get('translate-all', 'Show all') : __('Show all', 'betheme');
$translate['categories'] = mfn_opts_get('translate') ? mfn_opts_get('translate-categories', 'Categories') : __('Categories', 'betheme');
?>
<!-- #Content -->
<div id="Content">
<div class="content_wrapper clearfix">
<!-- .sections_group -->
<div class="sections_group">
<div class="extra_content">
<?php
mfn_builder_print(mfn_ID(), true);
?>
</div>
<div class="section section-filters">
<div class="section_wrapper clearfix">
<!-- #Filters -->
<div id="Filters" class="column one <?php
if ($iso) {
echo 'isotope-filters';
}
?>
">
<ul class="filters_buttons">
示例11: mfn_woocommerce_output_content_wrapper_end
function mfn_woocommerce_output_content_wrapper_end()
{
?>
</div>
</div>
</div>
</div>
</div>
<!-- .four-columns - sidebar -->
<?php
$layout = get_post_meta(mfn_ID(), 'mfn-post-layout', true);
if (is_active_sidebar('shop') && $layout != 'no-sidebar') {
if (is_product() && mfn_opts_get('shop-sidebar')) {
// product page without sidebar
} else {
echo '<div class="sidebar four columns">';
echo '<div class="widget-area clearfix ' . mfn_opts_get('sidebar-lines') . '">';
dynamic_sidebar('shop');
echo '</div>';
echo '</div>';
}
}
?>
</div>
</div>
<?php
}
示例12: get_template_part
<?php
if (mfn_header_style(true) == 'header-creative') {
get_template_part('includes/header', 'creative');
}
?>
<!-- #Wrapper -->
<div id="Wrapper">
<?php
// Header Featured Image -----------
$header_style = false;
if (mfn_ID() && !is_search()) {
if ((mfn_ID() == get_option('page_for_posts') || get_post_type() == 'page') && has_post_thumbnail(mfn_ID())) {
$subheader_image = wp_get_attachment_image_src(get_post_thumbnail_id(mfn_ID()), 'full');
$header_style = 'style="background-image:url(' . $subheader_image[0] . ');"';
}
}
?>
<?php
if (mfn_header_style() == 'header-below') {
echo mfn_slider();
}
?>
<!-- #Header_bg -->
<div id="Header_wrapper" <?php
echo $header_style;
?>
示例13: get_permalink
<li class="close"><a href="#"><i class="icon-cancel"></i></a></li>
</ul>
<ul class="tags">
<?php
echo '<li class="reset-inner"><a data-rel="*" href="' . get_permalink(mfn_ID()) . '">' . $translate['item-all'] . '</a></li>';
if ($tags = get_tags()) {
foreach ($tags as $tag) {
echo '<li><a data-rel=".tag-' . $tag->slug . '" href="' . get_tag_link($tag) . '">' . $tag->name . '</a></li>';
}
}
?>
<li class="close"><a href="#"><i class="icon-cancel"></i></a></li>
</ul>
<ul class="authors">
<?php
echo '<li class="reset-inner"><a data-rel="*" href="' . get_permalink(mfn_ID()) . '">' . $translate['item-all'] . '</a></li>';
$authors = mfn_get_authors();
if (is_array($authors)) {
foreach ($authors as $auth) {
echo '<li><a data-rel=".author-' . mfn_slug($auth->data->user_login) . '" href="' . get_author_posts_url($auth->ID) . '">' . $auth->data->display_name . '</a></li>';
}
}
?>
<li class="close"><a href="#"><i class="icon-cancel"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
示例14: get_template_part
get_template_part('includes/header', 'top-area');
}
?>
<?php
if (mfn_header_style(true) != 'header-below') {
if (is_shop() || mfn_opts_get('shop-slider') == 'all') {
echo mfn_slider($shop_id);
}
}
?>
</header>
<?php
add_filter('woocommerce_show_page_title', create_function(false, 'return false;'));
if (mfn_opts_get('subheader') != 'all' && !get_post_meta(mfn_ID(), 'mfn-post-hide-title', true)) {
if (is_product() || !mfn_slider($shop_id)) {
echo '<div id="Subheader">';
echo '<div class="container">';
echo '<div class="column one">';
// Title
$h = is_product() ? 2 : 1;
// h1 - shop, h2 - single product
echo '<h' . $h . ' class="title">';
woocommerce_page_title();
echo '</h' . $h . '>';
// Breadcrumbs
if (!mfn_opts_get('subheader')) {
$home = mfn_opts_get('translate') ? mfn_opts_get('translate-home', 'Home') : __('Home', 'betheme');
$woo_crumbs_args = apply_filters('woocommerce_breadcrumb_defaults', array('delimiter' => false, 'wrap_before' => '<ul class="breadcrumbs woocommerce-breadcrumb">', 'wrap_after' => '</ul>', 'before' => '<li>', 'after' => '<span><i class="icon-right-open"></i></span></li>', 'home' => $home));
woocommerce_breadcrumb($woo_crumbs_args);
示例15: mfn_opts_get
// Subheader | Print
if ($subheader_show) {
echo '<div id="Subheader" style="' . $subheader_style . '">';
echo '<div class="container">';
echo '<div class="column one">';
// Title
$title_tag = mfn_opts_get('subheader-title-tag', 'h1');
echo '<' . $title_tag . ' class="title">' . mfn_page_title() . '</' . $title_tag . '>';
// Breadcrumbs
if ($breadcrumbs_show) {
mfn_breadcrumbs($breadcrumbs_link);
}
echo '</div>';
echo '</div>';
echo '</div>';
}
}
}
?>
</div>
<?php
// Single Post | Template: Intro
if (get_post_meta(mfn_ID(), 'mfn-post-template', true) == 'intro') {
get_template_part('includes/header', 'single-intro');
}
?>
<?php
do_action('mfn_hook_content_before');