Single quotes within single quotes (PHP)
-
I’m attempting to make the following line of code work:
<?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('showposts=5'.'&paged='.$paged); query_posts('category_name= <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, <strong>'BlogCat'</strong>, true); ?> '.'&paged='.$paged); ?>
The BlogCat contains single quotes which are cancelling the other quotes and causing a syntax error. Cancelling the quotes (with a \)stops the error but the custom field is not called up. How do I fix this?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Single quotes within single quotes (PHP)’ is closed to new replies.