Forum Replies Created

Viewing 15 replies - 61 through 75 (of 99 total)
  • Thread Starter Akki

    (@luckyankit)

    Hi, Thanks for the quick reply.

    I am using the latest mobile theme provided by the newspaper theme plus activated AMP exactly as per the guide you linked. It has been like this always.

    Also, I am not using Wp-Rocket, don’t know why you thought so, but I am using the WP Super Cache plugin recommended by the Newspaper theme since long.

    Thread Starter Akki

    (@luckyankit)

    Although I wish if there was an option provided by AMP plugin to remove HTML comments in the rendered page as the cache plugins fail to do so.

    Thread Starter Akki

    (@luckyankit)

    I am using the same plugin on another site too, and it doesn’t happen there. I’ll still keep an eye on it as I installed the plugin yesterday only. But yeah that code being generated by theme could be the issue creator. Thanks a lot for the quick reply.

    Akki

    (@luckyankit)

    I also have same query since months. ??

    Akki

    (@luckyankit)

    Happened with me too but for some other plugin. It’s not just this plugin but could be any plugin. Disable object caching before deactivating any plugin as you keep seeing the old page from cache. That should resolve this issue.

    Oh yes, then I would skip it. I am already on verge of 50KB.

    I get this error too for my site. Should I try this?

    Thread Starter Akki

    (@luckyankit)

    Finally fixed the blank slide issue after testing numerous codes online which doesn’t provide solutions for comments, but all focus on post content only. Adding below code worked for me, hoping I did it the correct way:

    remove_filter( 'comment_text', 'wpautop', 30 );
    function wpse_wpautop_nobr( $content ) {
        return wpautop( $content, false );
    }
    add_filter( 'comment_text', 'wpse_wpautop_nobr', 30 );

    But I am still confused since AMP plugin controls the amp-carousel, how do I add the controls attribute to it – to make the buttons visible all the time?

    Don’t modify the plugin files as those will get overwritten in next update. Rather add this code to your theme functions.php file:

    add_filter( 'amp_schemaorg_metadata', '__return_empty_array' );

    This will remove the schema from any posts.

    Thread Starter Akki

    (@luckyankit)

    Wow, thanks a lot for literally coding a plugin for solving the issue. I removed this line add_filter( 'comment_text', 'do_shortcode' ) as suggested.

    I thought this line $comment_text = $wp_embed->run_shortcode( $comment_text ) in the plugin would enable the shortcode support for comment_text but it didn’t work. Now the embed code is displaying in raw as a part of the comment content.

    So as now the gallery shortcode in the comments is not working. Would await a solution for that from you ??

    Youtube embeds are working now.

    Again, Thanks a lot for that.

    • This reply was modified 5 years, 11 months ago by Akki.
    Thread Starter Akki

    (@luckyankit)

    It’s the usual comment text with standard wordpress gallery shortcode:

    Comment text

    [gallery link="file" columns="2" size="medium" ids="5400,5399"]

    And to embed video, it’s just any youtube video url only, no embed code.

    https://www.youtube.com/watch?v=YhickJGHsqw

    Video automatically embeds using oEmbed in comments.

    Thread Starter Akki

    (@luckyankit)

    I am not sure how and what to add from above code inside the AMP endpoint code? It’s not like add_action, remove_action thing here.

    Thread Starter Akki

    (@luckyankit)

    Above is the code from header.php file of the theme. It’s not the rendered code.

    • This reply was modified 5 years, 11 months ago by Akki.
    • This reply was modified 5 years, 11 months ago by Akki.
    Thread Starter Akki

    (@luckyankit)

    Thanks, that worked. Is there any way I could exclude the following code from AMP as well?

    <aside class="mobile-aside mobile-menu-wrap<?php echo ($mobile_menu == "light"?" light-mobile-menu":($mobile_menu == "dark"?" dark-mobile-menu":" gray-mobile-menu"))?>">
    		<div class="mobile-aside-inner">
    			<div class="mobile-aside-inner-inner">
    				<a href="#" class="mobile-aside-close">close</a>
    				
    				<?php $top_menu_mobile = vpanel_options("top_menu_mobile");
    				if ($top_menu_mobile == 1) {?>
    					<div class="mobile-menu-top mobile-aside-menu">
    						<?php if (is_user_logged_in()) {
    							wp_nav_menu(array('container_class' => 'header-top','menu_class' => '','theme_location' => 'top_bar_login','fallback_cb' => 'vpanel_nav_fallback'));
    						}else {
    							wp_nav_menu(array('container_class' => 'header-top','menu_class' => '','theme_location' => 'top_bar','fallback_cb' => 'vpanel_nav_fallback'));
    						}?>
    					</div>
    					<!--<?php wp_nav_menu( array( 'theme_location' => 'max_mega_menu_1' ) ); ?>-->
    				<?php }
    				
    				$ask_question_mobile = vpanel_options("ask_question_mobile");
    				if ($ask_question_mobile == 1) {?>
    					<div class="ask-question-menu">
    						<a href="<?php echo esc_url(get_page_link(vpanel_options('add_question')))?>" class="color button small margin_0"><?php _e("Ask a Question","vbegy")?></a>
    					</div><!-- End ask-question-menu -->
    				<?php }
    				
    				$mobile_cart = vpanel_options("mobile_cart");
    				if (class_exists('woocommerce') && $mobile_cart == 1) {
    					echo "<div class='cart-wrapper'>";
    						global $woocommerce;
    						$num = $woocommerce->cart->cart_contents_count;
    						echo '<a href="'.$woocommerce->cart->get_cart_url().'" class="cart_control nav-button nav-cart"><i class="enotype-icon-cart"></i>
    							<span class="numofitems" data-num="'.$num.'">'.$num.'</span>
    						</a>
    						<div class="cart_wrapper'.(sizeof($woocommerce->cart->get_cart()) < 1?" cart_wrapper_empty":"").'"><div class="widget_shopping_cart_content"></div></div>
    					</div>';
    				}
    				
    				if (is_user_logged_in()) {
    					$user_id = get_current_user_id();
    					$mobile_notifications = vpanel_options("mobile_notifications");
    					if ($mobile_notifications == 1 && $active_notifications == 1) {
    						include("includes/notification.php");
    					}
    				}
    				
    				$main_menu_mobile = vpanel_options("main_menu_mobile");
    				if ($main_menu_mobile == 1) {?>
    					<div class="mobile-menu-left mobile-aside-menu">
    						<?php wp_nav_menu(array('container_class' => 'header-menu','menu_class' => '','theme_location' => 'header_menu','fallback_cb' => 'vpanel_nav_fallback'));?>
    						<!-- <?php wp_nav_menu( array( 'theme_location' => 'max_mega_menu_2' ) ); ?> -->
    					</div><!-- End mobile-menu-left -->
    				<?php }
    				
    				$social_mobile = vpanel_options("social_mobile");
    				if ($social_mobile == 1) {?>
    					<div class="social_icons f_right">
    						<ul>
    							<?php if ($twitter_icon_f) {?>
    							<li class="twitter"><a target="_blank" class="tooltip-s" href="<?php echo $twitter_icon_f?>"><i class="icon-twitter"></i></a></li>
    							<?php }
    							if ($facebook_icon_f) {?>
    								<li class="facebook"><a target="_blank" original-title="<?php _e("Facebook","vbegy")?>" class="tooltip-s" href="<?php echo $facebook_icon_f?>"><i class="icon-facebook-f"></i></a></li>
    							<?php }
    							if ($gplus_icon_f) {?>
    								<li class="gplus"><a target="_blank" original-title="<?php _e("Google plus","vbegy")?>" class="tooltip-s" href="<?php echo $gplus_icon_f?>"><i class="social_icon-gplus font17"></i></a></li>
    							<?php }
    							if ($youtube_icon_f) {?>
    								<li class="youtube"><a target="_blank" original-title="<?php _e("Youtube","vbegy")?>" class="tooltip-s" href="<?php echo $youtube_icon_f?>"><i class="icon-youtube"></i></a></li>
    							<?php }
    							if ($skype_icon_f) {?>
    								<li class="skype"><a target="_blank" original-title="<?php _e("Skype","vbegy")?>" class="tooltip-s" href="skype:<?php echo $skype_icon_f?>?call"><i class="icon-skype"></i></a></li>
    							<?php }
    							if ($flickr_icon_f) {?>
    								<li class="flickr"><a target="_blank" original-title="<?php _e("Flickr","vbegy")?>" class="tooltip-s" href="<?php echo $flickr_icon_f?>"><i class="social_icon-flickr font17"></i></a></li>
    							<?php }
    							if ($linkedin_icon_f) {?>
    								<li class="linkedin"><a target="_blank" original-title="<?php _e("Linkedin","vbegy")?>" class="tooltip-s" href="<?php echo $linkedin_icon_f?>"><i class="icon-linkedin"></i></a></li>
    							<?php }
    							if ($rss_icon_f == 1) {?>
    								<li class="rss"><a original-title="<?php _e("Rss","vbegy")?>" class="tooltip-s" href="<?php echo (vpanel_options("rss_icon_f_other") != ""?vpanel_options("rss_icon_f_other"):bloginfo('rss2_url'));?>"><i class="icon-rss"></i></a></li>
    							<?php }?>
    						</ul>
    					</div><!-- End social_icons -->
    				<?php }
    				$search_mobile = vpanel_options("search_mobile");
    				if ($search_mobile == 1) {?>
    				<!--	<div class="post-search">
    						<form role="search" method="get" class="searchform" action="<?php esc_url(home_url('/'))?>">
    							<div class="row">
    								<div class="col-md-8">
    									<input type="search" name="search" value="<?php if (get_search_query() != "") {echo esc_html(get_search_query());}else {esc_html_e("Hit enter to search","vbegy");}?>" onfocus="if(this.value=='<?php esc_html_e("Hit enter to search","vbegy")?>')this.value='';" onblur="if(this.value=='')this.value='<?php esc_html_e("Hit enter to search","vbegy")?>';">
    								</div><!-- End col-md-8 -->
    							<!--	<div class="col-md-4">
    									<input type="submit" class="button-default" value="<?php esc_html_e('Search','vbegy')?>">
    								</div><!-- End col-md-4 -->
    							</div><!-- End row -->
    						</form>
    					</div>
    				<?php }?>
    			</div><!-- End mobile-aside-inner-inner -->
    		</div><!-- End mobile-aside-inner -->
    	</aside><!-- End mobile-aside -->
    Thread Starter Akki

    (@luckyankit)

    I believe this is the code, although I just shared the whole file at slack as well for your reference:

    add_action('comment_form', 'wpcommentiv_comment_form', 99);
    function wpcommentiv_comment_form()
    {
        
        if (!is_singular()) {
            return;
        }
    
        $options = get_option('wpcommentiv');
    	
    	
        //if ($options['field'] == 0)
        //{
    		
    		$images = 1;
    	if(isset($options['images'])){
    		$images = $options['images'];
    	}
           
            if (!isset($images) || !is_numeric($images)) $images = 1;
            for ($i=0; $i<$images; $i++)
            {
                echo '<div class="UploadPicture" data-toggle="tooltip" data-placement="top" title="" data-original-title="Attach a Photo">
                                                        <i class="icon-camera-retro" aria-hidden="true"></i> 
                                                        <input type="file" name="image" id="comment_img" title="' . htmlspecialchars($options['label']) . '">
                                                    </div> <div class="comtext" style="padding-top:8px; padding-left:50px;">Click the camera icon to upload an image to your answer/comment. One Image - Supported Extensions are JPG, GIF & PNG - Size Maximum - 2 MB. To embed multiple images, add image URLs to the answer/comment.</div>
    												<div class="WPImageComment">
    												
    												<div class="closePopUp">
    												<a data-close-popup="true" href="#" id="applyFilterOptionss">
    												<i class="icon-remove" aria-hidden="true"></i></a></div>
    												<div class="blahimage"><img id="blah" src="" alt="" valign="bottom"/></div>
    												</div>
    												
    												<style>
    												.WPImageComment { clear: both; padding-top:1px; display: block; }
    												.UploadPicture .form-group { margin-bottom:0px;}
    												.UploadPicture>input {position: absolute; top: 0; height:30px; width:400px; left:-30px; opacity:0; cursor:pointer;margin:0px; z-index:10;}
    												.UploadPicture { display: inline-block; color: #c7c7c7; font-size:25px; position:absolute; padding: 5px 10px; line-height: 39px; width: 46px; overflow: hidden; height: 38px;  cursor:pointer;}
    												.UploadPicture:hover { color:#999;}
    												 .closePopUp{
    													 position:absolute;
    													float:right;
    													vertical-align:top;
    													margin-top:5px; 
    													margin-left:15px; 
    													display:none;
    												}
    												.closePopUp a{
    												 color:#ff0000;
    												 cursor:pointer;
    												 font-size: 18px;
    												}
    												.filter-popup-is-shown .closePopUp{
    												display:inline-block;
    												}
    												</style>';
            //}
        } 
    }
Viewing 15 replies - 61 through 75 (of 99 total)