Add/Modify rel=canonical of all the pages of a wordpress website

You’ll want to prevent SEO plugins from adding a canonical meta tag, and then add your own canonical meta tag using wp_head filter (untested): add_action( ‘wp_head’, static function () { $url = trailingslashit( get_site_url() ); $url .= ltrim( $_SERVER[‘REQUEST_URI’], “https://wordpress.stackexchange.com/” ); printf( ‘<link ref=”canonical” href=”%s” />’, esc_attr( $url ) ); } );

How can i add a script with parameters?

Use wp_enqueue_script from your PHP code to register and enqueue a script. WordPress will then handle automatically adding the required script tags at the right place and you’ll be able to instantiate and use the API from your javascript. E.g. (untested, check the docs for your use case) wp_enqueue_script(‘googlemaps’, ‘https://maps.googleapis.com/maps/api/js?&key=KEY’);

wordpress media library description column

Use the nl2br() function (tested): function column_id_row( $columnName, $media_item ) { if ( ‘description’ !== $columnName ) { return; } $attachment_meta = get_post( $media_item ); echo nl2br( $attachment_meta->post_content ); } add_filter( ‘manage_media_custom_column’, ‘column_id_row’, 10, 2 );

How to get default variation ID (woocommerce)

Try this code add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2); function custom_variation_price( $price, $product ) { $available_variations = $product->get_available_variations(); $selectedPrice=””; $dump = ”; foreach ( $available_variations as $variation ) { // $dump = $dump . ‘<pre>’ . var_export($variation[‘attributes’], true) . ‘</pre>’; $isDefVariation=false; foreach($product->get_default_attributes() as $key=>$val){ // $dump = $dump . ‘<pre>’ . var_export($key, true) . ‘</pre>’; // $dump … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)