Forum Replies Created
-
AuthorReplies
-
srumery
ParticipantI reviewed the slider plugin and I see the “show-hide-toggle” code in use. It looks just like what I am applying. Since I can’t figure it out, I copied the code to a sandbox site that you can take a look at. How should I send you the login information?
I hope you can find out what is going on. This execution is really slick and I will have a few uses for it.
srumery
ParticipantIt’s on my local development machine. I’ll push up the code to a sandbox site and in the process, maybe I’ll figure something out.
I was looking for an example in the framework so I could duplicate it but the code for the Homepage Content selection (for “Posts” or “Custom Layout” selection) looks like it is written a different way. I also checked the Footer columns options from the Layout tab and didn’t see a match there either.
srumery
ParticipantI’m picking up what you’re laying down but I’m not able to get the receiver option to trigger. The option with the new
'class' => 'hide receiver receiver-menu_style_1'
is being hidden no matter what the option setting is in the trigger field.I have tried wrapping the subgroup_start array to include the trigger option (set it just before) as well as excluding it (adding it after) and the results are the same. The second option doesn’t trigger. Does the array for the subgroup_start go before the trigger option array?
array( 'type' => 'subgroup_start', 'class' => 'show-hide-toggle' ),
Here is the code I am using:
array( 'type' => 'subgroup_start', 'class' => 'show-hide-toggle' ), array( 'name' => 'Main Menu Style', 'desc' => 'Select a style for the main menu bar.', 'id' => 'main_menu_style', 'std' => 'menu_style_1', 'type' => 'select', 'options' => array( 'menu_style_1' => 'Standard - No changes applied', 'menu_style_2' => 'Modern - flat and boxy' ), 'class' => 'trigger' ), array( 'name' => 'Menu Border Color', 'desc' => 'Select a background color for the menu items', 'id' => 'main_menu_border_color', 'std' => '', 'type' => 'color', 'class' => 'hide receiver receiver-menu_style_1' ), array( 'type' => 'subgroup_end' ),
In this example, I am expecting the
main_menu_border_color
option to show when themenu_style_1
is selected in themain_menu_style
option and hide when themenu_style_2
is selected.What am I doing wrong here?
srumery
ParticipantI have a theme option tab called “Styles” and a new section of options that stores the menu style as well as three fields to store color values. Here are two fields from the section:
array( 'name' => 'Main Menu Style', 'desc' => 'Select a style for the main menu bar.', 'id' => 'main_menu_style', 'std' => 'menu_style_1', 'type' => 'select', 'options' => array( 'menu_style_1' => 'Standard', 'menu_style_2' => 'Modern' ) ), array( 'name' => 'Background Color', 'desc' => 'Select a background color for the menu items', 'id' => 'main_menu_background_color', 'std' => '', 'type' => 'color' )
Using just these two fields in this example, I would like to hide the field with the ‘id’ => ‘main_menu_background_color’ if the option from ‘id’ => ‘main_menu_style’ is set to ‘menu_style_1’. This is similar to what you are doing with the Homepage Content radio button selection for “Posts” or “Custom Layout”.
srumery
ParticipantBrilliant! This worked perfectly. Thank you so much.
srumery
ParticipantHi Jason,
Actually, I created a custom builder element that displays text on top of a full width background image. The text comes from a textarea I setup in the element and that’s where I would like to use shortcodes. The button shortcode I added doesn’t fire there. I think I saw a post about this some time ago but I can’t find it now.
The custom builder element has a unique ID (
$element_id = 'rum_landing_page_intro_section';
) when added to the theme by usingthemeblvd_add_builder_element
.I have reviewed the Layout Builder (API) documentation and I don’t see anything referencing shortcode support.
Is there a way to make sure shortcodes are executed in my custom builder element?
srumery
ParticipantI’ve got it all wrapped in a nice little plugin now. Brilliant!
Thank you, Jason.
srumery
ParticipantHa! Your post beat mine by 12 seconds. Thank you for your guidance and attention to detail. I love this framework!!
Onward!
srumery
ParticipantUPDATE: I added the code to an include file that is called from the child theme functions.php AFTER the call to the framework and it worked! This is great, thank you! 🙂
I would prefer this functionality be set in a plugin to make it more portable for other child themes. Can I call my custom builder function from the
after_setup_theme
hook like your other plugins similar to this?add_action( 'after_setup_theme', 'themeblvd_favicon_init' );
srumery
ParticipantI was putting it in a plugin so that I could use it across a few child themes. That was the intent but that approach may be causing the problem. I’ll add the code as an include file in one of my child themes for now.
If I am able to it as a plugin, what can I wrap around my code so it gets fired off at the right time?
srumery
ParticipantGot it. Now I understand. Thank you.
To remove the meta data on the post, I am using a template part and manually removing the call to
themeblvd_blog_meta();
. It would be really slick to remove/alter this content with a filter like you do for template parts.After a little digging…
Hey, if
themeblvd_blog_meta()
is an action hook, can’t I conditionally modify the output?// alter the metadata that is returned at the top of the post function rum_alter_post_metadata() { // if the post type is SERVICES, don't display any metadata at the top of the post if ( 'services' == get_post_type() ) { // return an empty string -or- don't echo anything } } add_action( 'themeblvd_blog_meta', 'rum_alter_post_metadata' );
Is there a better way to do this?
I also have noticed that if I use a custom post type with a taxonomy, the category field in the metadata output is blank. I could adjust the output to account for that using this method as well, right?
June 29, 2013 at 10:05 pm in reply to: [Theme Options API] How to use the "background" options type #9253srumery
ParticipantJust like you said… it’ll be working after the next update. I have it implemented and it’s working great.
Thank you!
srumery
ParticipantYou are exactly right. I was confusing the two. I applied your fix and everything is lining up properly.
Thank you!
srumery
ParticipantThat’s exactly what I was looking for. Thank you for pointing it out. I applied this condition and it worked perfectly:
if( 'sc_event' == get_post_type() )
srumery
ParticipantThank you for the response. I have been working with JumpStart quite a bit and hadn’t seen that yet so I wanted to eliminate it.
-
AuthorReplies