This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="row"> | |
| <?php | |
| $prod_arch_args = array( | |
| 'post_type' => 'products', | |
| 'posts_per_page' => '12', | |
| 'paged' => get_query_var( 'paged' ), | |
| ); | |
| $prod_arch_query = new WP_Query( $prod_arch_args ); | |
| if( $prod_arch_query->have_posts() ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $prod_cats = get_terms( 'product_cat', 'hide_empty=0' ); | |
| ?> | |
| <ul class="gk-special-menu"> | |
| <?php | |
| foreach( $prod_cats as $cat ){ | |
| $name = $cat->name; | |
| $prod_term_link = get_term_link( $cat ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- topplayer is the div id we'll be referencing in JS to make an iframe here --> | |
| <div id="topplayer"></div> | |
| <script> | |
| jQuery( document ).ready(function( $ ) { | |
| var tag = document.createElement( 'script' ); | |
| tag.src = "https://www.youtube.com/iframe_api"; | |
| var firstScriptTag = document.getElementsByTagName( 'script' )[0]; | |
| firstScriptTag.parentNode.insertBefore( tag, firstScriptTag ); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- topplayer is the div id we'll be referencing in JS to make an iframe here --> | |
| <div id="topplayer"></div> | |
| <script> | |
| jQuery( document ).ready(function( $ ) { | |
| var tag = document.createElement( 'script' ); | |
| tag.src = "https://www.youtube.com/iframe_api"; | |
| var firstScriptTag = document.getElementsByTagName( 'script' )[0]; | |
| firstScriptTag.parentNode.insertBefore( tag, firstScriptTag ); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function vg_show_post_id() { | |
| $p_id = $_REQUEST['post_id']; | |
| $title = get_the_title( $p_id ); | |
| if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { | |
| if (!empty($_SESSION['cart']) && array_key_exists( $p_id, $_SESSION['cart'] ) ) { | |
| $cnt = $_SESSION['cart'][$p_id]; | |
| $cnt++; | |
| $_SESSION['cart'][$p_id] = $cnt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The concept is to put a Button in Post Content which the user will click. | |
| Two things - The ID of the post and Number of times the user clicks the Button should be displayed. | |
| Underlaying Reason - With this we are presenting Posts as Products and with that button user can add products, | |
| and number of clicks on the button will signify the quantity that he wants. | |
| The logic is working well with the normal php session, but not working with WP_Session. | |
| Working php session - https://gist.github.com/vajrasar/8a8aa97de1b39f18ef29 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Disabling URL field | |
| function vg_disable_comment_url( $fields ) { | |
| unset( $fields['url'] ); | |
| return $fields; | |
| } | |
| add_filter('comment_form_default_fields','vg_disable_comment_url'); | |
| //To edit defaults in comment field |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .hide-excerpt { | |
| display: none; | |
| } | |
| #powerTip { | |
| max-width: 300px; | |
| white-space: normal !important; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Add the theme-opt.php file | |
| require_once('theme-opt.php'); | |
| /********************************** | |
| * | |
| * Replace Header Site Title with Inline Logo | |
| * | |
| * Fixes Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| This was working fine, I was able to show Title of image with a hyperlink to image lightbox. | |
| But suddenly from past a week site was down, when I checked error logs it stated | |
| that the code (which was in my functions.php) is throwing error - PHP Parse error: syntax error, unexpected '[' | |
| That error was in Line 24 of this code. | |
| */ |