Thursday, 19 September 2013

PHP function inside another.

PHP function inside another.

I'm trying to write a PHP loop which pulls all posts from a certain
category, and this category slug is pulled through another php function,
but the code doesn't seem to be doing anything.
Any help would be appreciated.
<?php
query_posts(array('category_name' => '<?php
echo(types_render_field("category-slug-to-pull", array())); ?>'));
if(have_posts()) :
while(have_posts()) : the_post();
?>
<li>
<h2><a href="<?php the_permalink() ?>"><?php the_title();
?></a></h2>
</li>
<?php
endwhile;
endif;
wp_reset_query();
?>

No comments:

Post a Comment