Product Category Page in Full Width

I will explain it to you without code at the moment, but in things need to be done: Before you render your category html, check its position (depth) from its current category upwards to the parent category. If the level is 2, then add the style you want to post_class (post_class($array)), otherwise do not add. … Read more

Code working in functions.php but not pluign for gavity forms

Put the add_filter() call in the init function: public function init(){ parent::init(); add_filter(“gform_submit_button”, array($this, “form_submit_button”), 10, 2); add_filter(“gform_confirmation”, array( $this, ‘custom_confirmation’ ), 10, 4 ); } And then add your custom_confirmation() function as a method to the class: class GFSimpleAddOn extends GFAddOn { /* all the other properties and methods */ public function custom_confirmation($confirmation, $form, … Read more

How to show random feed from DB and show content in my site

It’s difficult to answer this, but here are some suggestions: Make sure your feeds are valid, e.g. here. In the case of is_wp_error( $rss ) giving true, you can check the corresponding error message with $rss->get_error_message(). Develop with WP_DEBUG activated. Don’t use mysql_query(), it’s deprecated since PHP 5.5. Use the $wpdb object to fetch data … Read more

Custom archives page by month and year – nesting problem

After much more work, I developed a solution that outputs archives by year, month and day while minimising database calls. Posting it here for others to use: //* Add custom archives below entry content add_action( ‘genesis_entry_content’, ‘custom_archives_page_content’ ); function custom_archives_page_content() { global $post; // set post arguments $args = array( ‘posts_per_page’ => -1, ‘orderby’ => … Read more

Parse error: syntax error, unexpected ‘else’ (T_ELSE) [closed]

You aren’t ending your while before doing your else: $args = array( ‘post_type’ => ‘members_features’, ‘posts_per_page’ => 6 ); $the_query = new WP_Query( $args ); ?> <? if ( $the_query->have_posts() ) : ?> <? while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2><? the_title(); ?></h2> <div class=”entry-content”> <? the_content(); ?> </div> <? wp_reset_postdata(); ?> <?php /** … Read more

PHP Button Custom link [closed]

I’m not sure what byt_render_link_button() does, but I try this. <?php byt_render_field(“description clearfix”, “”, “”, $accommodation_description_html, ”, false, true); if (!empty($current_url) && $current_url == $list_user_accommodations_url) { byt_render_link_button($submit_accommodations_url . ‘?fesid=’ . $accommodation_id, “gradient-button clearfix”, “”, __(‘Edit’, ‘bookyourtravel’)); } else { byt_render_link_button( ‘http://www.mywebsite.com’, “gradient-button clearfix”, “”, __(‘Book now’, ‘bookyourtravel’) ); }