I moved over a development site to the client's hosting server using the WP Clone plugin. It seemed to work just fine, until I noticed a bunch of odd question marks where things like em-dashes and apostrophes should be. It appears to be a unicode issue, but the only difference I can tell between the two servers is that the client-side is using utf8mb4_unicode_c and my development server is using utf8_unicode_ci. If I copy and paste a page from the …
Our company has markets in USA, UK & Australia. We've just started using WP MU on our development server where the USA/global version is @ www.example.com, and then there are www.example.com/uk/ & www.example.com/au/. We're probably going to create an AJAX function to redirect the visitor based on their geographical location to the appropriate website, with www.example.com being the catch-all. I've come across the Yoast SEO wpseo_canonical filter which might help us set a canonical URL for all of our posts …
Story: I have custom role Staff for my WooCommerce shop, When a Customer create an Order, the Order is assigned a custom meta name handle_by where the value is a random value of user where role is Staff. When Staff is login and click WooCoomerce > Orders, He/She will only see Orders where handle_by is match current user id. Problem: How to filter WooCommerce > Order to only show Order where the custom meta handle_by is match with current user …
I'm creating a wordpress plugin that need to create a table and insert location data to that. There are more than 50000 locations in that INSERT query, so that in separate .sql file. I need to run that when I active the plugin. I'm creating table like below function locations_install() { global $wpdb; global $locations_db_version; $table_name = $wpdb->prefix . 'setfordslocations'; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE IF NOT EXISTS $table_name ( id int(11) NOT NULL AUTO_INCREMENT, town varchar(2000) CHARACTER …
I have the following script added to functions.php in my child theme: function getlatestfile() { $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('wp-content/uploads/cams/')); foreach ($iterator as $file) { if ($file->isDir()) continue; $path = $file->getPathname(); } return "<img src='https://mysite.url/" . $path . "' />"; } // register shortcode add_shortcode('getfieldimage', 'getlatestfile'); I can save the code, insert the shortcode [getfieldimage] on the page, and the page indeed displays the latest image. No complains. But when trying to edit again the page containing the shortcode, WP …
my website is using MyHome theme. I need to write identical names for two search fields. Here - https://komand.suvenirite.net/dava-pod-naem/?offer-type=rent And here- https://komand.suvenirite.net/prodava-offer-typesalecitygrad-sofia/?offer-type=sale Under the search field "ВИД НА ИМОТА" (the first one) The need for that is that the system gets confused if there are identical names even thought their parent fields are different, but for the client they need to appear the same. Yes, I have tried changing the structure, but of no use. The client is unbeatable. Adding …
I'm new to WordPress development. I have been following a tutorial in Udemy to build my new WordPress website. As recommended by the trainer, it is useful to use npm to package the JavaScripts using "@wordpress/scripts". The npm command monitors a single index.js file, which is then compiled into WordPress friendly version. Then in functions.php I added the wp_enqueue_script() function to call the index.js from build folder. The problem: I have created multiple JavaScript files, which contain new classes with …
I'm confused about this aspect of RNNs while trying to learn how seq2seq encoder-decoder works at https://machinelearningmastery.com/configure-encoder-decoder-model-neural-machine-translation/. It seems to me that the number of LSTMs in the encoder would have to be the same as number of words in the text (if word embeddings are being used) or characters in the text (if char embeddings are being used). For char embeddings, each embedding would correspond to 1 LSTM in 1 direction and 1 encoder hidden state. Is this understanding …
I'm storing posts, a user follows in a custom table that has the columns id, post_id and user_id. To fetch posts that a user follows I have extended the WP_Query as follows: class WP_Query_Posts_User_Follows extends WP_Query { function __construct($args=array()) { if ( !empty($args['followed_by']) ) { $this->followed_by = $args['followed_by']; add_filter('posts_where', array($this, 'posts_where')); } parent::query($args); } function posts_where($where) { global $wpdb; $table = $wpdb->prefix . 'post_followed_by'; $where .= $wpdb->prepare(" AND ID IN (SELECT post_id FROM $table WHERE user_id = %d)", $this->followed_by); return …
I have some custom posts that lists cars, motorcycles and trucks. The values in the ACF fileds are automaticaly populated and I cannot change them manually because they come from an external software. In this CPT I have 2 ACF fields (both are text fields): one called “Categroy” that can be Cars, Motorcycle, Truck. Another one called “Service”, that can be a value from 1 to 9. As you can see the “objects” can have different Categories but they maybe …
I am attempting to create a new custom block plugin in Wordpress v5.9.3. I'm following this Wordpress guide on creating a simple block. My block does not appear when I search for it in the Block Inserter, however. To try to rule out anything I may have done incorrectly I used the default Twenty Twenty Two theme and added the '01-basic' example provided in the Wordpress Gutenberg Examples to the plugins folder. Note that the basic example does not require …
In my research I have observed many of the face recognition algorithms propose their model accuracy interms of LFW dataset accuracy. I understood that LFW is a open source database and I did download that. I have developed my own DNN model implemented for face recognition which is similar to facenet architecture. Can anyone help with the procedure to calculate LFW accuracy of my model?
I'm trying to set my template to the Elementor Canvas when using wp_insert_post but it isn't working. It is creating the new page fine but not using the canvas. What am I doing wrong? { "action": "create_post", "post_author": "<authorID>", "post_content": "<post content>", "post_title": "Leave us a Review", "post_status": "publish", "post_type": "page", "comment_status": "closed", "post_name": "<post-name>", "page_template": "elementor_canvas" }
My WordPress admin area looks like the image linked below. I have tried reinstalling WordPress using the option in the Updates panel. But I cannot get it to revert. Has anybody had a similar problem and knows the solution? My guess is that it's CSS but shouldn't have to reinstall WP sorted that out? Need more rep to include this image in the post
I am in the process of a theme, I would like to add landing pages using page-templates. I cannot find anywhere that shows how to enqueue style or js for specific page templates. Any suggestions. Ex. Landing Page 1 - landing-page-template-one.php will need very different style and js than the blog or homepage.
I am building a woocommerce site and I have some input fields the on the product page. one is for recipient email (its for a gift car). Everything works, and the recipient email is saved on the order, but I want to be able to pass the email address to a function to update_meta_data so that I can use in other parts of the code (namely to send out a separate email to the recipient to redeem the card). here …
I have a Pandas data frame with columns within a survey with the following categorical values - "Increased, Decreased, Neutral". My question is how can I assign specific numerical values to these categorical values, namely +1 for Increased, -1 for Decreased and 0 for Neutral.
I've added support for datepicker on date fields in entry detail edit admin page of Gravity Forms. I did this by simply enqueuing the gform_datepicker_init script in admin_enqueue_scripts hook. This works perfectly as datepicker is displayed for date fields which was not available by default in entry detail edit page. My form has additional requirements and I want to limit the dates in a datepicker field. So, for that I want to take advantage of a JS filter gform_datepicker_options_pre_init provided …
I have a simple block that shows the most recent posts. But I want the number of posts to be changeable. To do that, I created a simple attribute and integrate it with a range control. const onChangePosts = ( newContent ) => { setAttributes( { numberPosts: newContent } ); }; <RangeControl value={ attributes.numberPosts } onChange={ ( value ) => onChangePosts( value ) } min={ 1 } max={ 10 } /> And here I'm getting the posts: const posts = …
I've developed a tool that retrieve the closest expressions from a database based on what the user typed. (using word embedding - a comparison is made between each expression from the database and the user input) n-result are retrieved but the closest expressions are not necessarily the most relevant one. For example, by typing : hospital machine The top results will be "dialysis machine", "medical machine", ... but I'll also find expressions like "building machine", "office machine" A user will …
I upload a lot of contracts, T&Cs, pdfs and audio file to my wordpress blog. I would like all of this content to be hidden from standard search engines. Is this possible?
I am new to Wordpress and would like to know how to add a specific admin menu item to the role Editor (in this case it is "User Login History"). This plugin shows its name for Administrator but not for Editor Please help
I have two sample groups of customers, each customer has 100s of features. For a single sample, i would use Decision Trees to find sub-groups that have a high churn rate. Thats easy. However, my requirement is: between two samples (below), find segment(s) such that in one sample its churn rate is high and in the other, it is low. In other words, find a sub-group which has the highest difference in churn rate. What is an appropriate algorithm to …
I have my blog on wordpress.com, I want it to be moved on self hosted server. I have exported data from my wordpress.com blog to XML file, However, When I went to import the data to my self hosted wordpress installation it says file must not be greater than 15MB and my file is of 2257 MB How do I go to import such a large file?
How would I go about step by step deriving stochastic gradient matrices w.r.t. W1 and W2 and backpropagation equation in a residual block that is a part of a larger ResNet network with forward propagation expressed as: $$ F(x) = \mathrm{W}_{2}^{} \mathrm{g}_{1}^{}(\mathrm{W}_{1}^{}x) $$ $$ y = \mathrm{g}_{2}^{} (F(x) + x) $$ and $$ \mathrm{g}_{1}^{}, \mathrm{g}_{2}^{} $$ are component-wise non-linear activation functions.
I don't know if there is a term for this. Is there an ai to create more samples from a single sample? a sample in music is a sound that has a unique pitch. for example .sf2 files used in music applications like fl studio have multiple samples. Sometimes I want an instrument that I hear in a song, so I want to extract all the samples from that instrument. but sometimes there is only one sample of the isolated …
I am developing a plugin that extends Woocommerce and acts as a custom product filter. The part I'm having trouble with is that it's not tied to one specific site, and has to fetch the products from an external API call, which is limited by 100 results per page, and I need just under 1000 products. I would prefer to get this data with one call only, without needing some hacky loop to glue together the results of the individual …
I am running Hierarchical Dirichlet Process, HDP using gensim in Python but as my corpus is too large it is throwing me following error: model = gensim.models.HdpModel(corpus, id2word=corpus.id2word, chunksize=50000) File "/usr/cluster/contrib/Enthought/Canopy_64/User/lib/python2.7/site-packages/gensim/models/hdpmodel.py", line 210, in __init__ self.update(corpus) File "/usr/cluster/contrib/Enthought/Canopy_64/User/lib/python2.7/site-packages/gensim/models/hdpmodel.py", line 245, in update self.update_chunk(chunk) File "/usr/cluster/contrib/Enthought/Canopy_64/User/lib/python2.7/site-packages/gensim/models/hdpmodel.py", line 313, in update_chunk self.update_lambda(ss, word_list, opt_o) File "/usr/cluster/contrib/Enthought/Canopy_64/User/lib/python2.7/site-packages/gensim/models/hdpmodel.py", line 415, in update_lambda rhot * self.m_D * sstats.m_var_beta_ss / sstats.m_chunksize MemoryError I have loaded my corpus using following statement: corpus = gensim.corpora.MalletCorpus('chunk5000K_records.mallet') And the data …
I have been searching for hours trying to find a way to test the update process for my plugin before tagging a new release in the repo. I have a function that is called using add_action( 'upgrader_process_complete', 'my_plugin_upgrade_function', 10, 2); and I can't figure out how to test this prior to release. Any help would be awesome!
I am doing experiments on bert architecture and found out that most of the fine-tuning task takes the final hidden layer as text representation and later they pass it to other models for the further downstream task. Bert's last layer looks like this : Where we take the [CLS] token of each sentence : Image source I went through many discussion on this huggingface issue, datascience forum question, github issue Most of the data scientist gives this explanation : BERT …
I have a Custom Post Type 'Production' with 'Tourdates' as a repeaterfield (using Advanced Custom Field plugin). Tourdates have a 'Date & Time Picker 'field named 'Playdate'. I would now like to display (in a list) all Playdates of all Productions sorted chronologically. My current query displays the posts like this: 09/04/2017 (Production x) 28/12/2017 (Production y) 07/04/2017 (Production x) 11/04/2017 (Production x) 31/04/2017 (Production y) 14/04/2017 (Production y) But I'm looking to get them displayed like this: 07/04/2017 (Production …
I've been trying to fix my pagination to work on custom post type slugs for example article/post-title/page/2 it just keeps showing the first page's results, the URL is changing but the posts remain the same My post type has rewrite slugs written like this 'rewrite' => ['slug' => 'article'], This is the query I used $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $args = [ 'numberposts' => -1, 'post_type' => $post_type, 'posts_per_page' => $post_per_page, 'post_status' => 'publish', 'paged' …
I got the following error, trying to call all posts or alle posts from a specific post type via the REST API: /wp-json/wp/v2/posts /wp-json/wp/v2/posts?page=1 /wp-json/wp/v2/posts?page=1&per_page=1 /wp-json/wp/v2/faq The error which appears is: { "code": "rest_post_invalid_page_number", "message": "The page number requested is larger than the number of pages available.", "data": { "status": 400 } } I got two posts within the custom post type and one normal post. What causes this error?