Forum Replies Created
-
AuthorPosts
-
November 22, 2013 at 12:55 pm in reply to: Displaying custom taxonomy list on archive page template #75056
lucaslem
MemberThanks Aaron,
I had found a clunky work-around, but will give this a go and report back.October 11, 2013 at 7:19 am in reply to: Diect edit CSS file of genesis framework sample theme #66251lucaslem
MemberYeah that does make sense.
October 11, 2013 at 7:05 am in reply to: Diect edit CSS file of genesis framework sample theme #66247lucaslem
MemberOne question though specific to the way Genesis child themes work: if that child theme css file is never going to be overwritten (nor will it be importing content from other framework files), why would one not simply make edits directly rather than adding styles to the end of the sheet in order to override styles from above?
October 11, 2013 at 6:28 am in reply to: Diect edit CSS file of genesis framework sample theme #66242lucaslem
MemberGreat thanks Brad!
October 8, 2013 at 11:08 am in reply to: Register widget area vs custom fields… pros & cons #65863lucaslem
MemberThanks to you both for your thoughts. Brad, I think your logic of determining whether I will be using the single hoook position for different content makes most sense in this case.
lucaslem
MemberNever mind, I found the solution by downloading the Genesis translation files for the main translation work and then using
load_child_theme_textdomain()
for my child theme strings. This post was a huge help in figuring out how to bring it altogether.Thanks!
lucaslem
MemberHi again Remkus,
I have followed your advice and am trying to do this using "proper translation files". I have followed your instructions here (so that I don't lose translations in future) and have both the .po and .mo file in my child theme folder.
I have some text inside custom call-to-action buttons which I need to translate. My hope was that I would be able to add custom strings to the .po file but it does not seem possible. Any ideas how I might go about adding a few strings to my .po file and then regenerating an .mo from that? Or do I need to create an entirely separate file? If so, do I just dump them in the same languages folder? Any advice or links to any tutorials would be appreciated.
October 3, 2013 at 5:15 pm in reply to: Making entire post entry clickable – Genesis Framework #65275lucaslem
Member3 days in I finally found the solution and figured I would share here for anyone else who might face the same issues. It's trial by fire here and it seemed I was missing the notion of the loop action hooks... and needing to put those in their own function to be applied conditionally. Many thanks to this blog post by Jonathan Perez!
So here's my final code:
//* 1. Conditionally remove post title, post meta and post info add_action('genesis_before_loop','ismh_workshops_no_entry_header'); function ismh_workshops_no_entry_header() { if( 'workshops' == get_post_type() && ! is_single() ) { //* Remove the entry title remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); //* Remove the entry header markup remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); //* Remove the entry meta in the entry header remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); //* Remove the entry meta in the entry footer remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); } } //* 2. Open link tag and add post title add_action('genesis_before_entry_content', 'ismh_open_article_link_tag'); function ismh_open_article_link_tag() { if( 'workshops' == get_post_type() && ! is_single() ) { echo '<a href ="' . get_permalink() . '"> <h1 class="entry-title" itemprop="headline">' . get_the_title() . '</h1>'; } } //* 3. Close link tag add_action('genesis_after_entry_content', 'ismh_close_article_link_tag'); function ismh_close_article_link_tag() { if( 'workshops' == get_post_type() && ! is_single() ) { echo '</a>'; } }
October 3, 2013 at 8:55 am in reply to: Making entire post entry clickable – Genesis Framework #65204lucaslem
Memberbump
October 2, 2013 at 8:12 am in reply to: Making entire post entry clickable – Genesis Framework #65063lucaslem
MemberOk, I have managed to get this working with these two functions:
add_action('genesis_before_entry_content', 'ismh_open_article_link_tag'); function ismh_open_article_link_tag() { if( is_post_type_archive( 'workshops' ) ) { echo '<a href ="' . get_permalink() . '"> <h1 class="entry-title" itemprop="headline">' . get_the_title() . '</h1>'; //* Remove the entry title (requires HTML5 theme support) remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); //* Remove the entry meta in the entry header remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); //* Remove the entry meta in the entry footer (requires HTML5 theme support) remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); } }
add_action('genesis_after_entry_content', 'ismh_close_article_link_tag'); function ismh_close_article_link_tag() { if( is_post_type_archive( 'workshops' ) ) { echo '</a>'; } }
However there seems to be a bug in that the first entry in the list still display the
<header class="entry-header">
which includes the linked post title as well as the entry meta. You can see a visual representation of this in this screenshot (sorry still working locally)Does anyone have any idea what could be causing this issue on the first post? Thanks.
October 1, 2013 at 2:45 pm in reply to: Making entire post entry clickable – Genesis Framework #64986lucaslem
MemberAnyone have ideas on this? What hooks can I use to add the necessary mark-up? So far neither genesis_before_entry_header nor genesis_after_entry_content seem to work. My code:
function ismh_open_article_link_tag() { echo '<a href ="' . get_permalink() . '">'; } add_action('genesis_before_entry_header', 'ismh_open_article_link_tag(');
function ismh_close_article_link_tag() { echo '</a>'; } add_action('genesis_after_entry_content', 'ismh_close_article_link_tag');
lucaslem
MemberHmmm, unless this small change requires a custom loop?
lucaslem
MemberThanks Remkus. I suppose you mean I should create a language file for my child theme. Can you point me in the direction of a tutorial for creating such files? I am using the CodeStyling Localization plugin but I can't find the info. Thanks.
lucaslem
MemberHello,
I am using your plugin with great success on a multisite install (main site = eng, sub-site = french).
I have changed the "read more" for excerpts and while it works in english, I cannot get it to display in french. Here is my code. Any advice would be welcome. Thanks!
//* Changing excerpt more - display where "read more tag" is used. add_filter('excerpt_more', 'auto_excerpt_more'); function auto_excerpt_more($more) { if ( 'fr_FR' == $language ) { return '… <a href="'.get_permalink().'" rel="nofollow">Lire</a>'; } else { return '… <a href="'.get_permalink().'" rel="nofollow">Read</a>'; } }
lucaslem
MemberThanks kfukawa, you're absolutely right. This case didn't occur to me as it's highly unlikely, given these are scheduled workshops, that they would have a date without a location, link etc (or any combination). However, I will refactor the code as you suggest just in case.
lucaslem
MemberUsed the ACF repeater fields addon and pretty sure I've solved my own issue:
//* Workshop registration call to action add_action( 'genesis_before_entry_content', 'ismh_workshops_registration_acf' ); function ismh_workshops_registration_acf() { if ( is_single() && 'workshops' == get_post_type() && get_field('registration_details') ) while( has_sub_field('registration_details') ): echo '<div class="registration-cta clearfix"> <div class="workshop-info"> <p class="workshop-info-data"><span class="workshop-info-callout">Date: </span>' . get_sub_field('workshop_date') . '</p> <p class="workshop-info-data"><span class="workshop-info-callout">Location: </span>' . get_sub_field('workshop_location') . '</p> </div> <a class="button" href="' . get_sub_field('registration_link') . '">Register Now!</a> </div>'; endwhile; }
Turns out when the fields are blank nothing displays 🙂 The learning curve is steep, but I'm getting there! If anyone sees anything horrendous about this code, please do chime in. Thanks!
lucaslem
MemberI've come up with another idea for this. I think repeater fields addon with AFC will allow the creation multiple call-to-action divs with same class. The only thing left is to have those divs render only when the custom fields within it are populated by the site editor. Seeing how this has largely strayed from original post, I have started a separate thread for this. Thanks.
lucaslem
MemberJust for clarification: the registration process happens externally (via eventbrite), so I don't need to build a registration form.
lucaslem
MemberHmmm, never thought a form plugin could be used in this way. Do you mean as a replacement for ACF or as a compliment? Will go through the GF documentation and do a google search to see if I can find some leads. Thanks!
lucaslem
MemberOh actually, looks like I need to take a different approach. In addition to the option of not being currently scheduled, each workshop may need to display more than one date and registration button at a time, therefore the need for the call-to-action div to repeat.
Hmmm, perhaps I should look up a tutorial for shortcodes. Then I could put all the registration details and div styling the div inside a shortcode and simply have them insert that in the custom field. If they have more than one event planned they can simply insert two shortcode lines in the custom field.
I have a screenshots which may make this more clear:
One registration link
Two registration links -
AuthorPosts