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

PHP get_custom_field函数代码示例

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

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



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

示例1: shortcode_output

 /**
  * Output for Shortcode
  *
  * @since 1.1.9
  *
  * @param $atts
  *
  * @return mixed|null
  */
 function shortcode_output($atts)
 {
     $default_atts = array('key' => '', 'field' => '', 'job_id' => get_the_ID());
     $merged_atts = array_merge($default_atts, $atts);
     try {
         // Attributes
         $args = shortcode_atts($merged_atts, $atts, 'jmfe');
         if (empty($args['key']) && empty($args['field'])) {
             throw new Exception(__('Meta Key was not specified!', 'wp-job-manager-field-editor'));
         }
         if (empty($args['job_id'])) {
             throw new Exception(__('Unable to determine correct job/resume/post ID!', 'wp-job-manager-field-editor'));
         }
         if ($args['key']) {
             $meta_key = $args['key'];
         }
         if ($args['field']) {
             $meta_key = $args['field'];
         }
         $post_meta = get_custom_field($meta_key, $args['job_id'], $args);
         if (is_array($post_meta)) {
             $post_meta = implode(', ', $post_meta);
         }
         return $post_meta;
     } catch (Exception $error) {
         error_log('Shortcode output error: ' . $error->getMessage());
     }
 }
开发者ID:durichitayat,项目名称:befolio-wp,代码行数:37,代码来源:shortcodes.php


示例2: widget

    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        echo $before_title . 'Active Projects' . $after_title;
        $order = array('Dev', 'Maintenance', 'Edit', 'Design', 'Dev Complete', 'Project Complete');
        echo '<ol>';
        foreach ($order as $order_item) {
            global $prefix;
            $args = array('category_name' => 'active-project', 'posts_per_page' => '-1', 'meta_query' => array(array('key' => $prefix . 'project_status', 'value' => $order_item)));
            $active = new WP_Query($args);
            global $prefix;
            $prefix = '_crm_';
            while ($active->have_posts()) {
                $active->the_post();
                global $post;
                $project_name = get_custom_field($prefix . 'project_name');
                if (!empty($project_name)) {
                    $name = $project_name . ' (' . get_the_title() . ')';
                } else {
                    $name = get_the_title();
                }
                ?>
				<li><a href="<?php 
                the_permalink();
                ?>
"><?php 
                echo $name;
                ?>
</a> <?php 
                edit_post_link('Edit', '(', ')');
                ?>
<br /> 
				<?php 
                $status_summary = get_custom_field($prefix . 'status_summary');
                $status = get_custom_field($prefix . 'project_status');
                if (!empty($status)) {
                    echo '<strong>Status:</strong> ' . $status;
                }
                if (!empty($status_summary)) {
                    echo ' | ' . $status_summary;
                }
                if (!empty($status) || !empty($status_summary)) {
                    echo '<br />';
                }
                $started = get_custom_field($prefix . 'start_date');
                if ($started) {
                    echo '<strong>Started:</strong> ' . date('F j, Y', strtotime($started)) . ',';
                }
                $revenue = get_custom_field($prefix . 'revenue');
                $expense = get_custom_field($prefix . 'expense');
                if ($revenue) {
                    echo 'Budget: $' . number_format($revenue - $expense) . '</li>';
                }
            }
        }
        echo '</ol>';
        wp_reset_query();
        echo $after_widget;
    }
开发者ID:joshuadavidnelson,项目名称:Genesis-CRM,代码行数:60,代码来源:widget-active-projects.php


示例3: be_complete_loop

function be_complete_loop()
{
    do_action('genesis_before_post_title');
    do_action('genesis_post_title');
    do_action('genesis_after_post_title');
    global $prefix;
    $args = array('category_name' => 'complete', 'posts_per_page' => '20', 'meta_query' => array(array('key' => $prefix . 'include_complete')));
    $complete = new WP_Query($args);
    setlocale(LC_MONETARY, 'en_US');
    $loop_counter = 0;
    while ($complete->have_posts()) {
        $complete->the_post();
        $revenue = get_custom_field($prefix . 'revenue');
        $expense = get_custom_field($prefix . 'expense');
        $profit = $revenue - $expense;
        $time = get_custom_field($prefix . 'time_setup') + get_custom_field($prefix . 'time_development') + get_custom_field($prefix . 'time_phone') + get_custom_field($prefix . 'time_hourly') + get_custom_field($prefix . 'time_other');
        if ($time) {
            $rate = money_format('%(#10n', $profit / $time);
        }
        if (!empty($revenue)) {
            $revenue = money_format('%(#10n', $revenue);
        }
        if (!empty($expense)) {
            $expense = money_format('%(#10n', $expense);
        }
        if (!empty($profit)) {
            $profit = money_format('%(#10n', $profit);
        }
        if ($loop_counter % 3 == 0) {
            echo '<div class="first project">';
        } else {
            echo '<div class="project">';
        }
        echo '<h3><a href="' . get_edit_post_link() . '">' . be_get_project_name() . '</a></h3>';
        echo '<p>';
        if ($revenue) {
            echo '<strong>Budget</strong>: ' . $revenue;
            if ($expense) {
                echo ' - ' . $expense . ' = ' . $profit;
            }
            echo '<br />';
        }
        if ($time) {
            echo '<strong>Time Spent:</strong> ' . $time . ' hrs <br /><strong>Effective rate:</strong> ' . $rate . ' /hr<br />';
        }
        echo '</p>';
        echo '</div>';
        $loop_counter++;
    }
}
开发者ID:joshuadavidnelson,项目名称:Genesis-CRM,代码行数:50,代码来源:template-complete.php


示例4: widget

    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        echo $before_title . 'Active Projects' . $after_title;
        $active = new WP_Query('category_name=active-project&posts_per_page=-1&showposts=-1');
        $count = 0;
        global $prefix;
        if ($active->have_posts()) {
            echo '<ol>';
            while ($active->have_posts()) {
                $active->the_post();
                global $post;
                $count++;
                ?>
				<li><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a> <?php 
                edit_post_link('Edit', '(', ')');
                ?>
<br /> 
				<?php 
                $status = get_custom_field($prefix . 'status_summary');
                if ($status) {
                    echo '<strong>Status:</strong> ' . $status . '<br />';
                }
                $started = get_custom_field($prefix . 'start_date');
                if ($started) {
                    echo '<strong>Started:</strong> ' . date('F j, Y', strtotime($started)) . '<br />';
                }
                $revenue = get_custom_field($prefix . 'revenue');
                $expense = get_custom_field($prefix . 'expense');
                if ($revenue) {
                    echo '<strong>Budget:</strong> $' . number_format($revenue - $expense) . '</li>';
                }
            }
            if ($count < 1) {
                echo "<p>Don't worry. I'm sure a few of those prospects listed in the left column will make the jump over here soon.</p><p>Or, maybe you haven't set up your categories yet. This area shows posts in the Active Projects category, so create a category with a slug 'active-project'.</p>";
            }
            echo '</ol>';
        } else {
            echo "<p>Don't worry. I'm sure a few of those prospects listed in the left column will make the jump over here soon.</p><p>Or, maybe you haven't set up your categories yet. This area shows posts in the Active Projects category, so create a category with a slug 'active-project'.</p>";
        }
        wp_reset_query();
        echo $after_widget;
    }
开发者ID:netcon-source,项目名称:CRM-Press,代码行数:50,代码来源:widget-active-projects.php


示例5: display_build_profiles

function display_build_profiles()
{
    query_posts(array('posts_per_page' => -1, 'offset' => 0, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => 'profile', 'post_status' => 'publish', 'suppress_filters' => true));
    if (have_posts()) {
        $return_string .= '<div id="profiles">';
        while (have_posts()) {
            the_post();
            if (has_post_thumbnail($post->ID)) {
                $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
            }
            $post = get_custom_field('graduated_from:get_post');
            $program_color = $post['program_color'];
            list($r, $g, $b) = sscanf($program_color, "%02x%02x%02x");
            $return_string .= '<div class="profiles-single"><a href="' . get_permalink() . '"><div class="profiles-thumb" style="background-image: url(' . $image[0] . ')"></div><div class="profiles-title" style="background: rgba(' . $r . ', ' . $g . ', ' . $b . ', .7);"><h2>' . get_the_title() . '</h2><h3>' . get_custom_field('associated_company') . '</h3></div></a></div>';
        }
        $return_string .= '</div>';
    }
    wp_reset_query();
    return $return_string;
}
开发者ID:randybruder,项目名称:Build-Institute,代码行数:20,代码来源:functions.php


示例6: widget

 /**
  * Front-end display of widget (Widget Output)
  *
  * @see WP_Widget::widget()
  *
  * @param array $args     Widget arguments.
  * @param array $config   Saved values from database.
  */
 public function widget($args, $config)
 {
     if (!function_exists('the_custom_field') || !function_exists('get_custom_field')) {
         return;
     }
     if (empty($config['meta_key'])) {
         return;
     }
     $meta_key = $config['meta_key'];
     // Set output_classes key to extra_classes value to be compatible with function
     $config['output_classes'] = $config['extra_classes'];
     // Set output_caption = caption to be compatible with function
     $config['output_caption'] = $config['caption'];
     $custom_fields = $this->jmfe()->get_custom_fields(TRUE);
     foreach ($custom_fields as $group => $fields) {
         if (array_key_exists($meta_key, $fields)) {
             $config = array_merge($custom_fields[$group][$meta_key], $config);
             break;
         }
     }
     // Exit if there is no value for field (to prevent widget output)
     $field_value = get_custom_field($config['meta_key'], get_the_id(), $config);
     if (empty($field_value)) {
         return;
     }
     $widget_styles = isset($config['widget_styles']) && !empty($config['widget_styles']) ? true : false;
     if ($widget_styles) {
         echo $args['before_widget'];
         if (!empty($config['title'])) {
             echo $args['before_title'] . apply_filters('widget_title', $config['title']) . $args['after_title'];
         }
     }
     the_custom_field($config['meta_key'], NULL, $config);
     if ($widget_styles) {
         echo $args['after_widget'];
     }
 }
开发者ID:durichitayat,项目名称:befolio-wp,代码行数:45,代码来源:widget.php


示例7: get_custom_field

<!-- Blurb Generator -->
<?php 
$blurbs = get_custom_field('page_blurbs');
$blurb_columns = get_custom_field('blurb_columns');
echo '<div class="container" ><div class="blurb-maker" column-rel="' . $blurb_columns . '">';
foreach ($blurbs as $blurb) {
    if ($blurb['link']) {
        $blurblink = '<a title="' . $blurb['title'] . '" target="_' . $blurb['target'] . '" href="' . $blurb['link'] . '" >';
        $blurbspotlink = '<a class="zoom-image-wrapper" title="' . $blurb['title'] . '" target="_' . $blurb['target'] . '" href="' . $blurb['link'] . '" >';
        $blurbendlink = '</a>';
    } else {
        $blurblink = '';
        $blurbspotlink = '';
        $blurbendlink = '';
    }
    echo ' 
    <div class="' . $blurb_columns . ' column columns">
	    <div class="module-container blurb">
	    	<div class="module">
	    		' . $blurbspotlink . '
			   		<img class="blurb-image zoom-image" src="' . $blurb['image'] . '" alt="' . $blurb['title'] . '" />
			   		<div class="zoom-overlay"><div></div></div>
			    ' . $blurbendlink . '
			</div>
			<div class="module-meta">
			    <h3 class="module-headline">' . $blurblink . '' . $blurb['title'] . '' . $blurbendlink . '</h3>
			    <p>' . $blurb['description'] . '</p>
			</div>	
		</div>
		
		
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:29,代码来源:element-blurbs.php


示例8: aboutUs

function aboutUs()
{
    get_custom_field('wpcf-about-us-home', TRUE);
}
开发者ID:johngilesyoder,项目名称:Glo,代码行数:4,代码来源:custom-fields.php


示例9: be_active_loop

function be_active_loop()
{
    echo '<div class="two-thirds first">';
    $order = array('dev', 'maintenance', 'edit', 'dev-complete', 'project-complete');
    setlocale(LC_MONETARY, 'en_US');
    foreach ($order as $order_item) {
        $loop_counter = 1;
        global $prefix;
        $args = array('category_name' => 'active-project', 'posts_per_page' => '-1', 'meta_query' => array(array('key' => $prefix . 'project_status', 'value' => $order_item)));
        $active = new WP_Query($args);
        if ($active->have_posts()) {
            echo '<h2 class="first">' . ucwords($order_item) . '</h2>';
        }
        while ($active->have_posts()) {
            $active->the_post();
            $status = get_custom_field($prefix . 'project_status');
            $type = get_custom_field($prefix . 'project_type');
            $status_summary = get_custom_field($prefix . 'status_summary');
            $revenue = get_custom_field($prefix . 'revenue');
            $expense = get_custom_field($prefix . 'expense');
            $profit = $revenue - $expense;
            if (!empty($revenue)) {
                $revenue = money_format('%(#10n', $revenue);
            }
            if (!empty($expense)) {
                $expense = money_format('%(#10n', $expense);
            }
            if (!empty($profit)) {
                $profit = money_format('%(#10n', $profit);
            }
            $work = get_custom_field($prefix . 'needs_work');
            if (empty($work)) {
                $work = 'yes';
            }
            $classes = array('project', strtolower($order_item), $work);
            if ($loop_counter % 2 == 1 && $loop_counter !== '1') {
                $classes[] = 'first';
            }
            echo '<div class=" ' . implode(' ', $classes) . '">';
            echo '<h4><a href="' . get_edit_post_link() . '">' . be_get_project_name() . '</a></h4>';
            echo '<p>';
            echo '<strong>' . ucwords($status) . '</strong>: ' . $status_summary . '<br />';
            if ($type) {
                echo '<strong>Type</strong>: ' . $type . '<br />';
            }
            if ($revenue) {
                echo '<strong>Budget</strong>: ' . $revenue;
            }
            if ($expense) {
                echo ' - ' . $expense . ' = ' . $profit . '<br />';
            }
            echo '</p>';
            echo '</div>';
            $loop_counter++;
        }
    }
    echo '</div><div class="one-third grey">';
    echo '<h1>Scheduled Projects</h1>';
    global $prefix;
    $args = array('category_name' => 'scheduled-project', 'posts_per_page' => '-1', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_key' => $prefix . 'date_dev_start');
    $scheduled = new WP_Query($args);
    global $be_output_end;
    $be_output_end = '';
    while ($scheduled->have_posts()) {
        $scheduled->the_post();
        $output = '';
        global $be_output_end;
        $start = get_custom_field($prefix . 'date_dev_start');
        $type = get_custom_field($prefix . 'project_type');
        $status_summary = get_custom_field($prefix . 'status_summary');
        $revenue = get_custom_field($prefix . 'revenue');
        $expense = get_custom_field($prefix . 'expense');
        $profit = $revenue - $expense;
        if (!empty($revenue)) {
            $revenue = money_format('%(#10n', $revenue);
        }
        if (!empty($expense)) {
            $expense = money_format('%(#10n', $expense);
        }
        if (!empty($profit)) {
            $profit = money_format('%(#10n', $profit);
        }
        $classes = array('project');
        $work = get_custom_field($prefix . 'needs_work');
        $classes[] = $work;
        $output .= '<div class="' . implode(' ', $classes) . '">';
        $output .= '<p><a href="' . get_edit_post_link() . '">' . be_get_project_name() . '</a><br />';
        $output .= '<strong>Scheduled for: </strong>' . date('F j, Y', $start) . '<br />';
        if ($status_summary) {
            $output .= '<strong>Status:</strong> ' . $status_summary . '<br />';
        }
        if ($type) {
            $output .= '<strong>Type:</strong> ' . $type . '<br />';
        }
        if ($revenue) {
            $output .= '<strong>Budget</strong>: ' . $revenue;
        }
        if ($expense) {
            $output .= ' - ' . $expense . ' = ' . $profit . '<br />';
        }
//.........这里部分代码省略.........
开发者ID:joshuadavidnelson,项目名称:Genesis-CRM,代码行数:101,代码来源:template-active.php


示例10: the_custom_field

 /**
  * Echo Custom Field Value
  *
  * Same as get_custom_field except will echo out the value
  *
  * @since    1.1.8
  *
  * @param       $field_slug Meta key from post
  * @param null  $job_id     Optional, Post ID to get value from
  * @param array $args
  *
  * @internal param null $output_as
  * @internal param null $caption
  * @internal param null $extra_classes
  */
 function the_custom_field($field_slug, $job_id = null, $args = array())
 {
     $field_value = get_custom_field($field_slug, $job_id, $args);
     if (isset($args['output_as']) && !empty($args['output_as'])) {
         the_custom_field_output_as($field_slug, $job_id, $field_value, $args);
     } else {
         if (is_array($field_value)) {
             $field_value = implode(', ', $field_value);
         }
         echo $field_value;
     }
 }
开发者ID:Atlas-Solutions-Group,项目名称:mn-wp-job-manager-field-editor,代码行数:27,代码来源:functions.php


示例11:

				
				
			<?php 
}
?>
	
			
			</div>
		</div>
		<!-- /CONTENT -->
		
		<!-- ============================================== -->
		
		<!-- SIDEBAR -->
		<?php 
if (get_custom_field('page_defaultpage_remove_sidebar') != 'Yes') {
    ?>
			<div class="sidebar primary-sidebar <?php 
    echo $sidebar_class;
    ?>
">			
			<?php 
    dynamic_sidebar('default-widget-area');
    ?>
	
		</div>
		<?php 
}
?>
		<!-- /SIDEBAR -->		
		
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:28,代码来源:page.php


示例12: widget

    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        echo $before_title . '10 Day Old Prospects' . $after_title;
        $old = new WP_Query('category_name=prospect&showposts=-1&posts_per_page=-1&order=ASC');
        $count = 0;
        global $prefix;
        if ($old->have_posts()) {
            echo '<ol>';
            while ($old->have_posts()) {
                $old->the_post();
                global $post;
                if ($post->post_date > date('Y-m-d', strtotime('-10 days'))) {
                    continue;
                }
                ?>
				<li><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a>, <?php 
                the_date();
                ?>
 <?php 
                edit_post_link('Edit', '(', ')');
                ?>
				<?php 
                $status = get_custom_field($prefix . 'status_summary');
                if ($status) {
                    echo '<br /><strong>Status:</strong> ' . $status;
                }
                ?>
				<br /><strong>Source:</strong> <?php 
                $sources = get_the_terms($post->ID, 'sources', '', ', ', '');
                $list = '';
                if ($sources) {
                    foreach ($sources as $data) {
                        $list .= $data->name . ', ';
                    }
                    echo $list;
                }
                echo '<br />';
                $email = get_custom_field($prefix . 'client_email');
                if ($email) {
                    echo '<strong>Email:</strong> ' . $email;
                }
                echo '<br />';
                $phone = get_custom_field($prefix . 'client_phone');
                if ($phone) {
                    echo '<strong>Phone:</strong> ' . $phone;
                }
                echo '<br />';
                ?>
				</li>
				<?php 
                $count++;
            }
            if ($count < 1) {
                echo "<p>WooHoo! You're either really fast at responding to prospects, or you haven't set up your categories yet. </p><p>This area shows posts that are 10 days or older and in the 'Prospect' category. If you haven't done so already, create a category with the slug 'prospect'.</p>";
            }
            echo '</ol>';
        } else {
            echo "<p>WooHoo! You're either really fast at responding to prospects, or you haven't set up your categories yet. </p><p>This area shows posts that are 10 days or older and in the 'Prospect' category. If you haven't done so already, create a category with the slug 'prospect'.</p>";
        }
        wp_reset_query();
        echo $after_widget;
    }
开发者ID:netcon-source,项目名称:CRM-Press,代码行数:70,代码来源:widget-old-prospects.php


示例13: test_get_custom_field

 function test_get_custom_field()
 {
     CCTM::$post_id = 75;
     $this->assertTrue(get_custom_field('rating') == 'R');
     $this->assertTrue(get_custom_field('rating:raw') == 'R');
     CCTM::$post_id = 77;
     $this->assertTrue(get_custom_field('gallery:gallery') == '<div class="cctm_gallery" id="cctm_gallery_1"><img height="2592" width="1936" src="http://cctm:8888/wp-content/uploads/2012/06/2012-VACATION-059.jpg" title="2012 VACATION 059" alt="" class="cctm_image" id="cctm_image_1"/></div><div class="cctm_gallery" id="cctm_gallery_2"><img height="313" width="637" src="http://cctm:8888/wp-content/uploads/2012/08/I-just-had-sex.jpg" title="I just had sex" alt="" class="cctm_image" id="cctm_image_2"/></div>');
 }
开发者ID:ethaizone,项目名称:custom-content-type-manager,代码行数:8,代码来源:CCTMUnitTests.php


示例14: get_the_title

        echo get_the_title();
        ?>
</p>
                      <p class="<?php 
        if ($i == 4) {
            echo 'lremb';
        } else {
            echo 'lrem';
        }
        ?>
" data-position="235,200" data-in="left" data-step="1"  data-delay="1500" data-out="fade"><?php 
        echo get_the_content();
        ?>
 </p>
                      <p class="teaser" data-position="325,200" data-in="left" data-step="1"  data-delay="1500" data-out="fade"><a href="<?php 
        echo get_custom_field("slide_link");
        ?>
 ">Learn how we work</a></p>
                   </div>
               <?php 
    }
    ?>
           
            <?php 
    $i++;
}
$wp_query = null;
$wp_query = $temp;
// Reset
?>
      </div>
开发者ID:foxydot,项目名称:chicagoneuro,代码行数:31,代码来源:front-page.php


示例15: crmpress_dashboard_widget

    function crmpress_dashboard_widget()
    {
        global $post, $prefix;
        echo '<h2 class="dash-title">' . get_bloginfo('name') . ' Project Information</h2>';
        echo '<div class="active-projects">';
        echo '<h2>Active Projects</h2>';
        echo '<ul class="column-one">';
        $active = new WP_Query('category_name=active-project&posts_per_page=20');
        while ($active->have_posts()) {
            $active->the_post();
            $revenue = get_custom_field($prefix . 'revenue');
            $expense = get_custom_field($prefix . 'expense');
            $budget = $revenue - $expense;
            $status = get_custom_field($prefix . 'status_summary');
            $url = get_custom_field($prefix . 'client_url');
            echo '<li>';
            ?>
    					<h3><a href="<?php 
            echo get_edit_post_link();
            ?>
"><?php 
            the_title();
            ?>
</a></h3>
    					Status: <?php 
            echo $status;
            ?>
<br />
    					Budget: <?php 
            if ($revenue) {
                echo '$';
            }
            echo $revenue;
            ?>
 - <?php 
            if ($expense) {
                echo '$';
            }
            echo $expense;
            ?>
 = $<?php 
            echo $budget;
            ?>
<br />
    					Website: <?php 
            if ($url) {
                ?>
 <a href="<?php 
                echo $url;
                ?>
" target="_blank"><?php 
                the_title();
                ?>
</a><?php 
            }
            ?>
    				<?php 
            echo '</li>';
        }
        echo '</ul>';
        wp_reset_query();
        echo '</div>';
        echo '<div class="scheduled-projects">';
        echo '<h2>Scheduled Projects</h2>';
        echo '<ul class="column-two">';
        $schedule = new WP_Query('category_name=scheduled-project&posts_per_page=10');
        while ($schedule->have_posts()) {
            $schedule->the_post();
            $revenue = get_custom_field($prefix . 'revenue');
            $expense = get_custom_field($prefix . 'expense');
            $budget = $revenue - $expense;
            $status = get_custom_field($prefix . 'status_summary');
            $action = get_custom_field($prefix . 'actionitem');
            echo '<li>';
            ?>
    					<h3><a href="<?php 
            echo get_edit_post_link();
            ?>
"><?php 
            the_title();
            ?>
</a></h3>
    					Status: <?php 
            echo $status;
            ?>
<br />
    					Budget: <?php 
            if ($revenue) {
                echo '$';
            }
            echo $revenue;
            ?>
 - <?php 
            if ($expense) {
                echo '$';
            }
            echo $expense;
            ?>
 = <span style="color: #0CB636;">$<?php 
            echo $budget;
//.........这里部分代码省略.........
开发者ID:netcon-source,项目名称:CRM-Press,代码行数:101,代码来源:dashboard.php


示例16: array

	<header id="header-homepage">
		
		<ul id="header-slider">
			<?php 
$args = array('numberposts' => 4, 'offset' => 0, 'orderby' => 'menu_order', 'order' => 'DESC', 'post_type' => 'header_slide', 'post_status' => 'publish', 'suppress_filters' => true);
$header_slides = get_posts($args);
foreach ($header_slides as $post) {
    setup_postdata($post);
    ?>
				<li style="background: linear-gradient( rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4) ), url('<?php 
    print_custom_field('header_image:to_image_src');
    ?>
') no-repeat center 30%; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;">
					
					<?php 
    $related_post = get_custom_field('related_program:get_post');
    $program_color = $related_post['program_color'];
    if ($program_color != '') {
        $rgb = hex2rgb($program_color);
        ?>
						<h1><span style="background-color: rgba(<?php 
        echo $rgb[0];
        ?>
,<?php 
        echo $rgb[1];
        ?>
,<?php 
        echo $rgb[2];
        ?>
,.7);"><?php 
        the_title();
开发者ID:randybruder,项目名称:Build-Institute,代码行数:31,代码来源:header-homepage.php


示例17: ot_get_option

<?php 
/* FontStack Loader */
if (ot_get_option('default_fontstack')) {
    ?>
	body{<?php 
    echo ot_get_option('default_fontstack');
    ?>
}
<?php 
}
?>



<?php 
/* Custom CSS (from user) */
echo ot_get_option('customcss');
echo get_custom_field('page_css');
?>
 

</style>


<?php 
/* ---------------------------------------------------------*/
/* TYPEKIT - HEADER EMBED CODE */
/* ---------------------------------------------------------*/
if (ot_get_option('alt_fontreplace')) {
    echo ot_get_option("alt_fontreplace");
}
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:31,代码来源:load-user-styles.php


示例18: print_custom_field

function print_custom_field($fieldname)
{
    print get_custom_field($fieldname);
}
开发者ID:feardax,项目名称:wordpress-custom-content-type-manager,代码行数:4,代码来源:functions.php


示例19: wp_reset_query

<!-- THE POST QUERY -->
<!-- This one's special because it'll look for our category filter and apply some magic -->
<?php 
wp_reset_query();
global $paged;
global $template_file;
if (get_post_custom_values('blog_post_count')) {
    $post_array = get_post_custom_values('blog_post_count');
    $post_count = join(',', $post_array);
} else {
    $post_count = -1;
}
/* Get Category Filter */
if (get_custom_field('blog_category_filter')) {
    $cats = get_custom_field('blog_category_filter');
    foreach ($cats as $cat) {
        $acats[] = $cat;
    }
    $cat_string = join(',', $acats);
}
$args = array('cat' => $cat_string, 'posts_per_page' => $post_count, 'paged' => $paged);
query_posts($args);
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:22,代码来源:query-blogtemplate.php


示例20: imageOne

		<div class="row product-top content" data-target="product-top">
			<div class="col-md-3 col-md-offset-1 product-image">
				<img src="<?php 
    imageOne();
    ?>
"/>
			</div>
			<div class="col-md-3 col-md-offset-1 product-image">
				<img src="<?php 
    imageTwo();
    ?>
"/>
			</div>
			<div class="col-md-3 col-md-offset-1 product-meta">
				<span class="product-name-badge"><?php 
    get_custom_field('wpcf-product-name-badge', TRUE);
    ?>
</span>
				<div class="rvalue">
					<p>R-VALUE:</p>
					<span><?php 
    rvalue();
    ?>
</span>
				</div>
			</div>
		</div>
		<div class="page-content">
			<?php 
    the_content();
    ?>
开发者ID:johngilesyoder,项目名称:Glo,代码行数:31,代码来源:single-product.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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