Changing post_id

i use the post id for a shortcode for my website and i want it so the id that i echo on website is flexible so the shortcode will change everytime i make a post get_row( $wpdb->prepare( “SELECT * FROM $wpdb->postmeta WHERE post_id = 5574″ ) ); echo do_shortcode (‘[sgpx gpx=”‘.’/wp-content/uploads/’ . $thepost->meta_value . ‘”]’);…

Details

Update product attribute when add to cart link is clicked in woocommerce

I have tried to add my custom data as product attribute when add to cart link is clicked. It is working fine when single custom entry is made. The code is as follows add_filter( ‘woocommerce_add_cart_item_data’, ‘save_in_cart_my_custom_product_field’, 10, 2 ); function save_in_cart_my_custom_product_field( $cart_item_data, $product_id ) { if( isset( $_SESSION[‘domain’] ) ) { $cart_item_data[ ‘name-on-tshirt’ ] =…

Details

Remove outliers from Raster

I was wondering if it’s possible to remove outliers from Raster datasetData > library (raster) > ras <- raster(“08_sa.tif”) > boxplot(ras) > summary(ras) 08_sa.tif Min. -6.010734e+17 1st Qu. -4.292327e+15 Median 3.456345e+15 3rd Qu. 5.913508e+15 Max. 3.954778e+17 NA’s 0.000000e+00 > dput(ras[1:10, 1:10]) 6158433346650112, NA, NA, NA, NA, 2607742007115776, 2877426224857088, 3185328672210944, 3353694611439616, 3688539120205824, 3618639601205248, 3899686960234496, 4037082158727168 >…

Details

Changing legend in plotnine

I have a question regarding legend in a plotnine plot. import pandas as pd import numpy as np from pandas.api.types import CategoricalDtype from plotnine import * from plotnine.data import mpg %matplotlib inline c= pd.read_excel(“cenpv.xlsx”) c.head() dodge_text = position_dodge(width=0.9) (ggplot(c, aes(x=’exon’, y=’mean’)) + geom_bar(stat=’identity’, position=’dodge’, show_legend=False) + geom_text(aes(label=’percentage’), position=dodge_text, size=8, va=’bottom’, format_string='{}%’) + geom_hline(aes(yintercept = “Overall…

Details