Gatto Nero
Forum Replies Created
-
Ok, I did it myself: the problem was in the theme I was building my child theme onto: Bootstrap by 320.
They decided to have the gallery shortcode replaced on a sub-sub-php file. I had to hard-remove it from the parent theme. That’s sad.
Thanks, the same question bugged me a lot, this morning.
I wait for this possibility too. I think it’s very important, really, like really really. ??
Forum: Hacks
In reply to: Getting posts from a specific post_format onlySomehow, I did it.
I wrote the code here, in case someone needed it ??
<?php $galleryposts = get_posts('category_name=post-format-gallery&post_count=4'); foreach($galleryposts as $post) : setup_postdata($post); ?> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php endforeach; ?>
What I’ve learnt:
- The sample codes on the Codex don’t work always
- get_posts seems to work perfectly as wp_query… but don’t use arrays ??
- post-formats create a special category name called post-format-NAMEOFTHEFORMAT
Forum: Hacks
In reply to: Getting posts from a specific post_format onlyI’ll add something… funny ??
I tried to create a new category, called “gallery”, without adding a specific slug.
Wordpress automagically created the slug “post-format-gallery”.(Obviously, I’m not able to make get_posts function with category_name, but…)
I’ve read the Codex for a solution, but my lack of knowing the PHP makes me not understand how it works, which is the logic beside the code
I tried, but it seems something beyond my abilities…