Forum Replies Created
-
AuthorPosts
-
trashParticipant
Hey,
I just used the Genesis child theme and customized it for my own purposes.trashParticipantHey Brad,
thanks - but I think non of this will work, but this is more because of my site structure.I have a front page with the following contents:
// remove Genesis default loop remove_action( 'genesis_loop', 'genesis_do_loop' ); // add a custom loop add_action( 'genesis_loop', 'custom_loop' ); function custom_loop () { content_ittb('Recently in Lifestyle', 'lifestyle', 2); content_fw('Recently in People', 'people', 2); } genesis();
The content_ittb / content_fw functions are getting data from the database and display it. So they will be on the same front page, but each of those functions will have a different layout. If I now use the body class, the body class of the whole page will be changed. Both functions will use my content-wrapper function as pasted above, but I wanted to differ between them.
So when calling content_ittb the content-wrapper should be another than the one which is used with content_fw. I might change my function to not use genesis_markup to accomplish this. Even the genesis_attr-content-wrapper class which I can fire inside of content_ittb changes the class on every content-wrapper div...
trashParticipantI want to add a custom class in order to style it..
trashParticipantI pasted both examples which I tried, but when checking of this works I am just using one code snippet at a time.
Isn't it strange, that the files get created, but the dropdown does not show the size at all....hm
trashParticipantHey braddalton,
thanks - I looked in the Codex. I just found out, that on the FTP I have the image in size 214x214, but the Dropdown-List when I want to insert the Image in a Post is missing that size.How can that happen? Did I miss any setting which adds 214x214 to the dropdown menu?
trashParticipantThanks.
March 5, 2015 at 3:51 am in reply to: How to use a different template for post format 'gallery'? #143270trashParticipantFor everyone else - I solved it and this seems to be working fine:
functions.php:
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); add_action('genesis_entry_content', 'custom_entry_content'); function custom_entry_content() { if (get_post_format() == 'gallery' ) { get_template_part('content',get_post_format()); } else { the_content(); } }//function
Within the content-gallery.php:
<?php // check if the repeater field has rows of data if( have_rows('gallery_block') ): // loop through the rows of data while ( have_rows('gallery_block') ) : the_row(); ?> <div class="gallery-block-wrapper"> <div class="gallery-block-img"> <img src="<?php the_sub_field( 'gallery_block_picture' ); ?>" /> </div> <div class="gallery-block-headline"> <?php the_sub_field( 'gallery_block_headline' ); ?> </div> <div class="gallery-block-text"> <?php the_sub_field( 'gallery_block_content' ); ?> </div> </div><!-- gallery-block-wrapper --> <? endwhile; endif;
March 5, 2015 at 3:44 am in reply to: How to use a different template for post format 'gallery'? #143268trashParticipantThanks, but I thought that this forum is for those who paid for Genesis and need help. I do not want to register on another website and pay $37.
March 5, 2015 at 3:33 am in reply to: How to use a different template for post format 'gallery'? #143265trashParticipantI also tried it with this:
add_filter('the_content','test_filter'); function test_filter($content) { if ( get_post_format() == 'gallery' ) get_template_part('content',get_post_format()); }//function
But this seems to be executed not only on post content, but for general content. So the content for the post got executed within the post and directly after the
<body>
I think the solution with the filter for the_content is perfect, but I need to ensure that this is only taken into consideration within the loop. So I have to create a fully custom loop, right?
March 5, 2015 at 2:59 am in reply to: How to use a different template for post format 'gallery'? #143263trashParticipantYep, exactly.
March 5, 2015 at 2:43 am in reply to: How to use a different template for post format 'gallery'? #143258trashParticipantMeanwhile I started with creating a fully customized loop including another template when "gallery" is set:
`$query = new WP_Query($arg);
if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();if ( has_post_format( 'gallery' )) {
get_template_part('content',get_post_format());
} else {
?>
<article <?=post_class();?>>
<header class="entry-header">
<h2 class="entry-title" itemprop="headline">
<a href="<?=the_permalink();?>" rel="bookmark"><?=the_title();?></a>
</h2>
</header>
<div class="entry-content" itemprop="text">
<p><?=the_content();?></p>
</div>
</article>
<?php
}//else
endwhile;
endif;`But how can I use include the post meta info like date/author into the code above in order to keep the genesis meta hooks etc?
March 5, 2015 at 2:40 am in reply to: How to use a different template for post format 'gallery'? #143257trashParticipantHey braddalton,
yep - but how? I tried it withget_template_part(‘content’,get_post_format());
but how can I take this template into consideration in my loop?trashParticipantThanks.
trashParticipantAnybody can help?
trashParticipantFound it. The site-title a was set to height: 164px.
-
AuthorPosts