I am having a problem and after 2 days wasted searching for a solution it is my last bullet. My project has a listing page which should bring all the customer names. Those names have this structure:
Category Clients (ID=90)
Subcategory Lufthansa
Subcategory BMW
What I need is from the WP_Query or the template handling print only the name of the subcategories of clientes, but not the posts which are in these categories.
Note: I need to do it in this way because I am using a function to bring the content by ajax, to make the effect “load more”.
I would appreciate so much any answer, even if is to say that is not possible.
Thanks people
]]><?php $cats = array(
'type' => 'post',
'child_of' => 71,
'orderby' => 'name',
'order' => 'ASC',
);?>
<?php
query_posts('$cats&posts_per_page=45' );
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
Anyone can help me?
I suppose it should not so difficult but now drives me crazy!
thanks!
]]>I am currently using a custom theme where I have a page which displays posts from a particular category. For this page only I need to strip the images from content which is displayed but it does not seem to be working.
I have placed the following code in my functions.php doc:
if (is_page(305)) {
add_filter('the_content', 'strip_images', 2);
function strip_images($content){
return preg_replace('/<img[^>]+./','',$content);
}
}
However, this does not seem to be working. I am guessing this is because I am not actually displaying the content of page 305, but because I am querying posts from a particular category using this page. How can I strip the images out of the content I am displaying for this page only? I do, however, need to show images in the content when I am viewing the post fully using single.php.
Thanks.
]]>Currently, I am using the following code which is showing all of the posts from the custom post type, rather than just the category. I’ve tried filtering the category by number but it doesn’t want to play ball.
Any ideas?
This is the code that is doing the filtering at the moment:
<?php query_posts('post_type=book','category_name=new_release'); ?>
<?php
// The Query
$the_query = new WP_Query( 'post_type=video&tag=space' );
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
But since I’m using this query all posts are showing up in parent category and children categories without caring about the category they belong.
Before I had `<?php
if (have_posts()) : while (have_posts()) : the_post();
?>` and it was working fine.
How can I accomplish what I’d like to?
]]>However the page template is currently displaying over 4 posts. Is there something else I need to tie into this page? I’m really trying to get the next_posts_link to activate, however no such luck yet. Here’s my code:
[Code moderated as per the Forum Rules. Please use the pastebin]
]]>Well, it worked for highlighting the menu option but now the other links on the page (https://cornhill.org/cornhillbeta/living-here/links/) have the post title for the Gazette page. That wasn’t supposed to happen.
The code:
[Code moderated as per the Forum Rules. Please use the pastebin]
Can anyone tell me how to remove the titles for the subpages but keep the blog format for the Gazette page/category?
Thank you so much!