[OFFER ALERT!] This Halloween, Get Any Premium Theme for Just $19 [GET IT NOW]
Jump to content

dalewoods007

Member
  • Posts

    21
  • Joined

  • Last visited

Posts posted by dalewoods007

  1. Hey team.

    I wanted to activate the rank math redirection module.

    However, it won't turn on.

    I press the switch and it will move, but nothing happens.

    When the page is refreshed, it is back in the inactive position again.

    You can see in the console, no javascript errors, and also nothing in my php error log.

    I first noticed this on my live site, then I went to my local xampp setup... same thing.

    I did deactivate plugins etc, can't get it to work.

    Can you guys check to see if you can replicate this issue?

    Thank you

     - Dale

     

    redirection module not turning on.png

  2. Hi guys

    I would like two do things...

    1. Filter the breadcrumbs output 
    2. Filter the breadcrumbs schema output

     

    For the breadcrumb output, I found this line on 136 in class-breadcrumbs.pp

    /**
    * Allow changing the HTML output of the breadcrumbs class
    *
    * @param string      $html   HTML output.
    * @param array       $crumbs The crumbs array.
    * @param Breadcrumbs $this   Current breadcrumb object.
    */
    return $this->do_filter( 'frontend/breadcrumb/html', $html, $crumbs, $this );

     

    However my filter does not get fired

    /*  
     *   Fix Breadcrumbs
     */
    add_filter('rank_math/frontend/breadcrumb/html', function($html, $crumbs, $context) {
        echo '<pre style="display:block">' . print_r($html, true) . '</pre>'; exit();
    }, 10, 3);

     

    Could you please tell let me know if you spot something wrong there.

    Also, could you please provide the filter that allows me to modify the breadcrumbs schema output.

     

    That would be very helpful thank you.

     

  3. On 12/23/2018 at 8:41 PM, Montgomerie said:

    We will be releasing an update on Monday evening which should fix the issue but the users will have to fill an additional field for all their products, which will be cumbersome. It will stay like that unless WooCommerce releases an update, fixing the issue in their plugin.

    Hey guys, 

    New version is out now, but I can't see any extra fields to edit for woo commerce products.

    I was hoping to see a brand field in there, which is a new thing the google schema checker warns you about.

    Where can I edit this now?

  4. Hey guys

    I want to filter the JSON-LD product schema before it is outputted.

    I was able to do this with the Woo Commerce filter add_filter( 'woocommerce_structured_data_product', ...

    The schema theme is using the Rank Math schema builder. I tried to track down where the code is being generated and I found this.

    	/**
    	 * JSON LD output function that the functions for specific code can hook into.
    	 */
    	public function json_ld() {
    		/**
    		 * Collect data to output in JSON-LD.
    		 *
    		 * @param array  $unsigned An array of data to output in json-ld.
    		 * @param JsonLD $unsigned JsonLD instance.
    		 */
    		$data = $this->do_filter( 'json_ld', array(), $this );
    		if ( is_array( $data ) && ! empty( $data ) ) {
    			echo '<script type="application/ld+json">' . wp_json_encode( array_values( array_filter( $data ) ) ) . '</script>' . "\n";
    		}
    	}

    There is this line $data = $this->do_filter( 'json_ld', array(), $this );

    Which I traced back should translate into a wordpress filter called like this...

    add_filter( 'rank_math/json_ld', function($data) {
    	print_r($data);
    });

    Only an empty array is pushed through this filter hook, and that makes sense because only an empty array is passed through that do_filter rank math method.

    What is the correct way to filter this so I can add on to the JSON-LD data... I want to add brand, and some other pieces that the google schema checker is whining about.

     

×
×
  • Create New...