Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #20863
    tkabe
    Member

    Checking out Catch Everest Pro – did not see a feature related to swipe for mobile devices to allow user to zoom in. Current Catch Everest does not support this feature. Suggestions or thoughts?

    #20866
    Sakin
    Keymaster

    @tkabe: Yes it’s not allowed. If you need that feature then you need to build child theme and create functions.php file in your child theme and add the following code:

    <?php
    // Removing the Default Action Hook
    function unhook_catcheverest_functions() {
    	remove_action( 'wp_head', 'catcheverest_responsive', 5 );
    }
    add_action( 'init', 'unhook_catcheverest_functions' );
    
    //Responsive Meta in Child Theme 
    function catcheverest_child_responsive() {
    	// Getting data from Theme Options
    	global $catcheverest_options_settings;
       	$options = $catcheverest_options_settings;
    	$disable_responsive = $options[ 'disable_responsive' ];
    	
    	if ( $disable_responsive == "0" ) {	
    		echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
    	}
    }
    add_action( 'wp_head', 'catcheverest_child_responsive', 5 );
    #20881
    tkabe
    Member

    I get this error
    >>Parse error: syntax error, unexpected ‘<‘ in /home/content/44/10651744/html/wp-content/themes/catch-everest-child/functions.php on line 98<<

    after adding the mobile swipe and the remove “Permalink To” php code you provided to functions.php code posted below.

    child theme functions.php
    <?php

    /** CPA Customization
    * Unassociated – discover what this is related to
    *
    * @uses catcheverest_header action to add it in the header
    */
    function register_my_menus() {
    register_nav_menus(
    array(
    ‘primary’ => __( ‘Profile Menu’ ),
    ‘sidebar-menu’ => __( ‘Sidebar Menu’ )
    )
    );
    }
    add_action( ‘init’, ‘register_my_menus’ );

    function image_tag($html, $id, $alt, $title) {
    return preg_replace(array(
    ‘/’.str_replace(‘//’,’//’,get_bloginfo(‘url’)).’/i’,
    ‘/s+width=”d+”/i’,
    ‘/s+height=”d+”/i’,
    ‘/alt=””/i’
    ),
    array(
    ”,
    ”,
    ”,
    ‘alt=”‘ . $title . ‘”‘
    ),
    $html);
    }
    add_filter(‘get_image_tag’, ‘image_tag’, 0, 4);

    /** CPA Customization
    * Shows Featured Post Slider
    *
    * @uses catcheverest_header action to add it in the header
    */
    function catcheverest_post_sliders() {
    //delete_transient( ‘catcheverest_post_sliders’ );

    global $post, $catcheverest_options_settings;
    $options = $catcheverest_options_settings;

    if( ( !$catcheverest_post_sliders = get_transient( ‘catcheverest_post_sliders’ ) ) && !empty( $options[ ‘featured_slider’ ] ) ) {
    echo ‘<!– refreshing cache –>’;

    $catcheverest_post_sliders = ‘
    <div id=”main-slider” class=”container”>
    <section class=”featured-slider”>’;
    $get_featured_posts = new WP_Query( array(
    ‘posts_per_page’ => $options[ ‘slider_qty’ ],
    ‘post__in’ => $options[ ‘featured_slider’ ],
    ‘orderby’ => ‘post__in’,
    ‘ignore_sticky_posts’ => 1 // ignore sticky posts
    ));
    $i=0; while ( $get_featured_posts->have_posts()) : $get_featured_posts->the_post(); $i++;
    $title_attribute = apply_filters( ‘the_title’, get_the_title( $post->ID ) );
    $excerpt = get_the_excerpt();
    if ( $i == 1 ) { $classes = “post hentry slides displayblock”; } else { $classes = “post hentry slides displaynone”; }
    $catcheverest_post_sliders .= ‘
    <article class=”‘.$classes.'”>
    <figure class=”slider-image”>

    ‘. get_the_post_thumbnail( $post->ID, ‘slider’, array( ‘title’ => esc_attr( $title_attribute ), ‘alt’ => esc_attr( $title_attribute ), ‘class’ => ‘pngfix’ ) ).’

    </figure>
    <div class=”entry-container”>
    <header class=”entry-header”>
    <h1 class=”entry-title”>
    ‘.the_title( ‘<span>’,'</span>’, false ).’
    </h1>
    </header>’;
    if( $excerpt !=”) {
    $catcheverest_post_sliders .= ‘<div class=”entry-content”>’. $excerpt.'</div>’;
    }
    $catcheverest_post_sliders .= ‘
    </div>
    </article><!– .slides –>’;
    endwhile; wp_reset_query();
    $catcheverest_post_sliders .= ‘
    </section>
    <div id=”slider-nav”>
    <
    >
    </div>
    <div id=”controllers”></div>
    </div><!– #main-slider –>’;

    set_transient( ‘catcheverest_post_sliders’, $catcheverest_post_sliders, 86940 );
    }
    echo $catcheverest_post_sliders;
    }

    /** CPA Customization
    * Allow Mobile swip/gestures
    *
    * @uses catcheverest_header action to add it in the header
    */
    function unhook_catcheverest_functions() {
    remove_action( ‘wp_head’, ‘catcheverest_responsive’, 5 );
    }
    add_action( ‘init’, ‘unhook_catcheverest_functions’ );

    //Responsive Meta in Child Theme
    function catcheverest_child_responsive() {
    // Getting data from Theme Options
    global $catcheverest_options_settings;
    $options = $catcheverest_options_settings;
    $disable_responsive = $options[ ‘disable_responsive’ ];

    if ( $disable_responsive == “0” ) {
    echo ‘<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>’;
    }
    }
    add_action( ‘wp_head’, ‘catcheverest_child_responsive’, 5 );

    ?>

    #20882
    Sakin
    Keymaster

    @tkabe: Your code looks messy. So, can you post your code in http://gist.github.com/ and send me the core link url. Then I will be able to check in.

    #20884
    tkabe
    Member

    I searched the file using notepad ++ and the WP editor and could not find an error in line 98.

    Adding the PHP code for the remove “Permalink To” at first allowed the server refresh as you described using theme options however now this fails and causes the error described.

    I had to upload the functions.php from a backup to get the site back up.

    #20885
    Sakin
    Keymaster

    @tkabe: I cannot check in your child theme functions.php file form here. That is why you need paste our code in github and send me the link. Then I will check in the code and send you the feedback. I think you are not using the code with ' and "

    #20889
    tkabe
    Member

    I am working on sharing the file in GitHub shortly.

    #20892
    tkabe
    Member

    Sakin – the file cpa_child_functions.php a copy of the functions.php file may be found here – https://github.com/tkabe/GitHub_code_help

    Thank you for your review.

    #20902
    Sakin
    Keymaster

    @tkabe: There is no such issue in the code that you have posted in GitHub, I have cleaned the code and proposed the changes in GitHub as your code didn’t have write permission. The only thing I am confused is why the file name is cpa_child_functions.php it should be just ‘functions.php`

    #20938
    tkabe
    Member

    Sorry Sakin, I am not clear where you put the changes. I looked in my GitHub and at the file itself and did not see your post.

    I understand the correct system file name is on “functions”.php I created this name simply to keep this file from conflicting with any saved original or child theme file on your end or my end.

    #20939
    Sakin
    Keymaster

    @tkabe: When I add in the code in my child them functions.php file. It is working fine. Maybe you can upload your complete child theme in dropbox or somewhere I can download it. Maybe you have problem with other files.

    #20948
    tkabe
    Member

    I uploaded the new modified code you provided in the GitHub Branch and got a different error code –
    Parse error: syntax error, unexpected T_FUNCTION in /home/content/44/10651744/html/wp-content/themes/catch-everest-child/functions.php on line 8

    I appreciate your generous assistance, however after carefully rebuilding the functions.php file both the mobile gestures and removal of “Permalink To” are working. I would consider this issue closed. Thank you very much for providing excellent support!

    Here are my steps I performed to fix the file.
    1. Restored functions.php from a recent backup.
    2. Tested this file – working ok.
    3. This time I added the mobile gestures code to functions.php first before any other new code. I used the editor in WP and updated the file – successfully.
    4. Refreshed the server – deactivated webclips in theme options.
    5. tested gestures on mobile successfully.
    6. Added the code to remove “Permalink To” into the functions.php file using WP editor and updated the file – successfully.
    7. Refreshed the server – activated webclips in theme options.
    8. Test in homepage slider – successfully.

    #20949
    Sakin
    Keymaster

    @tkabe: Happy to see that you fixed your issues. Thanks 🙂

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Mobile Device Swipe’ is closed to new replies.