Tag Info

Hot answers tagged

3

You're assigning a value to $dish, but then not using it... Try the following. It takes advantage of the fact that your image for "gluten" is named gluten.png, etc. You'll be able to add more tags by just adding to the $images array. $images = array( "gluten" => "Gluten Free", "vegan" => "Vegan Friendly", "vegetarian" => ...


2

Here is my solution for a Custom Post Type: Add this to functions.php. (Or, if you created a template for your custom post type like I did, such as single-instrument.php, add it to that instead of functions.php) // Display Advanced Custom Fields add_action('genesis_entry_header', 'type_of_instrument'); function type_of_attorney() { if ( ...


1

For anyone with the same problem, here's the answer. I finally figured it out. // Display Profile Sidebar ACF add_action('genesis_sidebar', 'employee_title'); function profile_photo() { if ( is_singular('profile') && genesis_get_custom_field('employee_title') ) echo '<div id="employee-title"> '. genesis_get_custom_field('employee_title') ...


1

I don't know of any WordPress-specific way to exclude duplicate-title posts from a query and I'm sure that there are multiple ways to address this. The solution that jumps to mind is to store each post title in an array and then check to see if that title is already there before outputting the post. Some quick untested code: <?php $args = array( ...


1

Just a simple php if to check the contents of the field before outputting markup. <?php if( $second_comment = get_field('second_content_block') ){ ?> <div class="page-content-text-additional"> <?php echo do_shortcode("[vr_jsp] $second_comment [/vr_jsp]"); ?> </div> <?php } ?> You can eliminate the need ...


1

Wanted: Add the ability to join/unjoint an event for registered client. Allow the admin to manage/review easily each event participants. Here is what I will do for a full management CMS Create a custom meta box that you will attach to your CPT "event". (this meta box will display the name of every person that are linked to the event, also, the ...


1

I would create a custom post type of "tickets" - I find it easier to just use a CPT register plugin then remove it. You may prefer to code it yourself in which case plenty of information is available on the Codex. When that person clicks join use something like: //first define your post info $post = array( 'post_title' => 'Ticket for ...


1

Here is what I ended up doing based on @gdaniel's suggestion: AJAX call: $('.btn').click(function() { $.ajax({ url:"<?php bloginfo('template_directory'); ?>/inc/galleries.php", type: 'POST', data: {postID: '<?=$post->ID;?>', galleryCategory: $(this).attr("data-content")}, success: function(resp) { ...



Only top voted, non community-wiki answers of a minimum length are eligible