Thread Starter
draig
(@draig)
I’m using Genesis theme (Dynamic Website Builder as child theme) so I removed the default loop with
remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
then added a custom loop
add_action( ‘genesis_loop’, ‘my_custom_loop’ );
function my_custom_loop() {
what do I put in here to use CCS?
}
Hi draig,
I use it like this, maybe it will help you.
In taxonomy-my_tax_name.php I have this part:
<?php if (have_posts()) : while (have_posts()) : the_post();
get_template_part( 'content', 'my_tax_name' );
endwhile;
endif; ?>
In content-my_tax_name.php I have this code:
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php echo do_shortcode('[content type="template" name="my_post_name" field="html"]'); ?>
</article>
I have a post type “template” where I added a field “html”. In the post named “my_post_name” I have a code like this:
<div class="my_tax_name-item" >
[field title]
[field image]
...
</div>
Does it helps you?
Hi draig,
Is there any repository of CCS examples in php templates?
Currently, the documentation doesn’t have any info about use in PHP templates. I’ll try to improve that.
There are a couple of helper functions you can use inside your custom loop:
start_short();
?>
..your shortcodes here..
<?php
end_short();
For displaying posts in the default query loop:
[the-loop]
[field title], etc.
[/the-loop]
I’m not familiar with the Genesis theme or its page builder, so you can see if the above examples actually work.
—
Hi Peter, thank you for helping out in the support forum. I saw another thread where you gave some helpful info. I appreciate it!
Thread Starter
draig
(@draig)
Hi Eliot,
I had found the start_short and end_short functions where you had mentioned them in another thread… but it was [the-loop] that I was missing. That does the trick.
Thanks for your help
ps – thanks too Peter for trying.