Forum Replies Created

Viewing 15 replies - 16 through 30 (of 40 total)
  • Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Ohh I see its cause of “Public => false”

    But Taxonomies is not going to be the public

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Yes we have custom taxonomy.

    // Register Custom Taxonomy
    function products_taxonomy() {
    $labels = array(
    ‘name’ => _x( ‘Products’, ‘Taxonomy General Name’, ‘aff’ ),
    ‘menu_name’ => __( ‘Products’, ‘aff’ ),
    ‘all_items’ => __( ‘All Product’, ‘aff’ ),
    ‘parent_item’ => __( ‘Parent Product’, ‘aff’ ),
    ‘parent_item_colon’ => __( ‘Parent Product :’, ‘aff’ ),
    ‘new_item_name’ => __( ‘New Product Name’, ‘aff’ ),
    ‘add_new_item’ => __( ‘Add New Product’, ‘aff’ ),
    ‘edit_item’ => __( ‘Edit Product’, ‘aff’ ),
    ‘update_item’ => __( ‘Update Product’, ‘aff’ ),
    ‘separate_items_with_commas’ => __( ‘Separate Product with commas’, ‘aff’ ),
    ‘search_items’ => __( ‘Search Product’, ‘aff’ ),
    ‘add_or_remove_items’ => __( ‘Add or Remove Product’, ‘aff’ ),
    ‘choose_from_most_used’ => __( ‘Choose from Most Used Product’, ‘aff’ ),
    );

    $args = array(
    ‘labels’ => $labels,
    ‘hierarchical’ => true,
    ‘public’ => false,
    ‘show_ui’ => true,
    ‘show_admin_column’ => true,
    ‘show_in_nav_menus’ => false,
    ‘show_tagcloud’ => false,
    ‘rewrite’ => array(‘slug’ => ‘products’),
    );

    register_taxonomy( ‘products’, array(‘resources’,’post’), $args );
    }

    // Hook into the ‘init’ action
    add_action( ‘init’, ‘products_taxonomy’, 3);

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    I didn’t see any option for Custom Taxonomy in settings. Refer to the screenshot

    https://we.tl/t-8BoxPZmvYl

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hi Thank you for you support.. One last help

    How can we enable on Custom Taxonomy Archive Page .. i.e my custom taxonomies are products so siteurl.com?products=productname&amp=true doesn’t work.

    As we have custom archive for product taxonomy so we already have URL routes defined.

    add_rewrite_rule( ‘^/blogs/category/products/([^/]*)/?’, ‘index.php?products=$matches[1]’,’top’ );

    Now i have set

    add_rewrite_rule( ‘^/blogs/category/products/([^/]*)/amp?’, ‘/blogs/category/products/=$matches[1]/?amp’,’top’ );

    this converts my url
    /blogs/category/products/PRODUCTNAME/amp

    But as i have mentioned we have custom RULES to get the posts accordingly which logic are written under custom archive pages.

    But its always keeps me on default archive page. I have create a my custom file as well but its not working

    Please suggest

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Here is the URL

    https://bit.ly/2Uqx6gl

    Forum: Plugins
    In reply to: [AMP] Page unable to reach
    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hi Weston,

    As i already mentioned above that Layout of the website is messed up with transitional mode. I debug it and found that stylesheet.css which is under css directory is not getting call on amp site. AMP site just picking up theme root style.css. Another thing is our website navigation are using JS/Bootstrap features which another that impacts the website layout.

    Thanks

    Forum: Plugins
    In reply to: [AMP] Page unable to reach
    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hi Weston,

    Thank you, It works. but one new issue I have realized that once after updates, it validation is Valid but website style has been completely broken. After debug I found that its getting on theme root’s style.css however my theme has different style which is under css directory.

    I’ll be glad if you can tell me where i am doing wrong.

    AMP mode is Transitional.

    When I use array(‘template_dir’=>’amp’) this gives error “PHP Fatal error: Uncaught Error: Using $this when not in object context in amp/single.php”.

    Looking forward to hear from you.

    Thanks

    Forum: Plugins
    In reply to: [AMP] Page unable to reach
    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Here is the error

    
     PHP Fatal error: Uncaught DOMException: Not Found Error in /wp-content/plugins/amp/includes/sanitizers/class-amp-base-sanitizer.php:489\nStack trace:\n#0 /wp-content/plugins/amp/includes/sanitizers/class-amp-base-sanitizer.php(489): DOMElement->removeAttributeNode(Object(DOMAttr))\n#1 /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php(587): AMP_Base_Sanitizer->remove_invalid_attribute(Object(DOMElement), Object(DOMAttr), Array)\n#2 /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php(304): AMP_Tag_And_Attribute_Sanitizer->process_node(Object(DOMElement))\n#3 /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php(287): AMP_Tag_And_Attribute_Sanitizer->sanitize_element(Object(DOMElement))\n#4 /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php(287): AMP_Tag_And_Attrib in /wp-content/plugins/amp/includes/sanitizers/class-amp-base-sanitizer.php on line 489
    
    Forum: Plugins
    In reply to: [AMP] Page unable to reach
    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hi @westonruter I have changed the function but still same fatal error. Please refer to the code below.

    
    public function remove_invalid_attribute( $element, $attribute, $validation_error = [] ) {
    		if ( is_string( $attribute ) ) {
    			$node = $element->getAttributeNode( $attribute );
    		} else {
    			$node = $attribute;
    		}
    		$should_remove = $this->should_sanitize_validation_error( $validation_error, compact( 'node' ) );
    		
    +		if ( $should_remove && $element === $node->parentNode ) {
     			$element->removeAttributeNode( $node );
     			$this->clean_up_after_attribute_removal( $element, $node, $validation_error );
     		}
    		return $should_remove;
    	}
    
    Forum: Plugins
    In reply to: [AMP] Page unable to reach
    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    @westonruter Hi, Yes for the meantime I have to disable it. As it was giving 500 Error. I am going to setup all the stuff on development URL now and will add the hack which you shared.

    Forum: Plugins
    In reply to: [AMP] Page unable to reach
    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    PHP Fatal error: Uncaught DOMException: Not Found Error in /wp-content/plugins/amp/includes/sanitizers/class-amp-base-sanitizer.php:477\nStack trace:\n#0 /wp-content/plugins/amp/includes/sanitizers/class-amp-base-sanitizer.php(477): DOMElement->removeAttributeNode(Object(DOMAttr))\n#1 /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php(585): AMP_Base_Sanitizer->remove_invalid_attribute(Object(DOMElement), Object(DOMAttr), Array)\n#2 /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php(302): AMP_Tag_And_Attribute_Sanitizer->process_node(Object(DOMElement))\n#3 /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php(287): AMP_Tag_And_Attribute_Sanitizer->sanitize_element(Object(DOMElement))\n#4 /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php(287): in /wp-content/plugins/amp/includes/sanitizers/class-amp-base-sanitizer.php on line 477

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hi James

    Thanks for your reply, i have an idea to remove the Visual composer, I have already mentioned you that our page is built with Visual composer so i can’t remove that style.

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hi James,

    I have figure it out, actually our blog is a page and then assigned to post page. On Pages I have enabled Visual composer so there is a default CSS file for visual composer which is already slightly bigger in size. Cause our themes css file is already adding on blog single pages cause Visual composer is not activated on the blog pages.

    Please suggest any alternatives. Cause visual composer is the core page builder we can’t disable it.

    Thank

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Fixed above one, by hooks

    One another error CSS didn’t combine
    “The following stylesheets are too large to be included in style[amp-custom]:”

    Please suggest as this is the main css.

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hey @craigstanfield Its a blog page, In Backend under blog page setting this blog page is selected as well as page is calling from theme index file.

Viewing 15 replies - 16 through 30 (of 40 total)