我学习PHP,有一个基本的问题,呼叫在function.php功能的WordPress
我的页面有这样的代码portfolio.php
<?php
$args = array(
'post_type' => 'portfolio',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => -1
);
$portfolio_query = new WP_Query($args);
if($portfolio_query->have_posts()) :
echo '<div id="primary" class="hfeed">';
while($portfolio_query->have_posts()) : $portfolio_query->the_post();
// project url
$portfolio_url = get_post_meta($post->ID, '_zilla_portfolio_project_url', true);
if(!empty($portfolio_url))
$portfolio_button_copy = get_post_meta($post->ID, '_zilla_portfolio_project_url_copy', true);
?>
我想在我的function.php
echo
$portfolio_url
任何参考更多的研究在这种情况下,将不胜感激。
嗯,你为什么要回声到你的functions.php文件? – Bill
因为我在我的function.php中有一个函数,它回显''标记,我想在那里回显'href'! – user3067592
好的,你在哪里调用你的函数? – Bill