Am trying to add custom path to my article posttype so my article path will be www.example/parent-post-1/parent-post-2/the-actual-post i tried to add this code /** * @param $post_link * @param $id * Добавить название категории продукта к ссылке * @return array|mixed|string|string[] */ function wpa_course_post_link($post_link, $id = 0) { $post = get_post($id); if ($post instanceof WP_Post) { $parent = get_field('parents', $post->ID) ?: []; $link = ''; foreach ($parent as $post) { $link .= $post->post_name . '/'; } if ($parent) { $post_link = …
I have an existing AJAX action that's already defined by the theme I'm using. The action deletes a search item request, and I'd like to use it as a direct link - like an Unsubscribe link - emailed to the user along with the search results... Something like the following URL: https://domain.tld/wp-admin/admin-ajax.php?action=delete_saved_search_item=&search_item_id=17 but I get a 0 on the screen and a 400 Bad Request in the Headers. Basically in the JS it's defined like this: $.post(ajaxurl, { action: 'delete_saved_search_item', …
I'd like to train a model to predict the constant and variable parts in log messages. For example, considering the log message: Example log 1, the trained model would be able to identify: 1 as the variable Example, log labeled as the constants. To train the model, I'm thinking of leveraging a training dataset that would have all tokens in all of the log entries annotated. For example, for a particular log entry in the dataset, we would have a …
I have this deep neural network model with an integer label to predict. The label is heavily skewed so we cap the labels at some value (let's say 90 %ile). Now when we build and run the model, it performs well in general. But in online experiment shows degradation in business metrics for a fraction of users that have high value labels. If we don't cap the label, the business metrics gets skewed for users with low number of activities. …
I'm using add_submenu_page() function to add some options to my plugin. On Linux hosting everything works like it should, on Windows hosting those 5 sub-menus have same link somehow and when I click on them page just reloads. What can be issue? Both hosts are using same PHP version. Here is the code $this->page_hooks['link1'] = add_submenu_page(__FILE__, __('link1', 'domain'), __('link1', 'domain'), $acl_table['manage_link1'], 'wp-plugin-link1', array($this, 'on_manage_link1')); $this->page_hooks['link2'] = add_submenu_page(__FILE__, __('link2', 'domain'), __('link2', 'domain'), $acl_table['manage_link2'], 'wp-plugin-link2', array($this, 'on_manage_link2')); $this->page_hooks['link3'] = add_submenu_page(__FILE__, __('link3', 'domain'), …
Is there a way to get a specific entity based on the context where it is found? For example: The temperature today is 35°C. Store risperidone tablet at 20°C. Both are talking about temperature. For the first sentence, I would want the temperature to be a "WeatherTemperature" entity. In the second sentence, I would want the temperature to be "DrugTemperature". What model could I use to train for this behavior?
I am learning WordPress Plugin development. In this regard I have to save some settings along with Custom Post in Admin Panel under a Menu. Can I place metaboxes inside tab for this issue like the below image ?
Wordpress doesn't natively search for tags so I need to install WP Extended Search and add post_tags as one of its parameters so whenever I search for keywords natively, posts with that tag will appear. However, when I tried searching on the wp-json REST API, that post doesn't appear. Here's an example with a post that is tagged with "technology". When I search "technology " using this json rest api url, it returns an empty array: example.com/posts?search=technology But if I …
I have created three different models using deep learning for multi-class classification and each model gave me a different accuracy and loss value. The results of the testing model as the following: First Model: Accuracy: 98.1% Loss: 0.1882 Second Model: Accuracy: 98.5% Loss: 0.0997 Third Model: Accuracy: 99.1% Loss: 0.2544 My questions are: What is the relationship between the loss and accuracy values? Why the loss of the third model is the higher even though the accuracy is higher?
Vectorization techniques like TF-IDF are very common techniques for transforming text data into numerical data that can be more easily feed to ML Algorithms. Before we first train the model, each word of each document is given a number (a frequency) which depends on the whole data. How can I input to the already trained model, a new custom, unseen before sentence since the model was trained with the whole dataset vectorized? For instance, my new sentence has a different …
I'm developing some custom blocks in the new Gutenberg editor experience, and I'm struggle to understand how to use some build-in components, mostly the Draggable components. What I would like to achieve is a list of items (let's say many li in a ul) and I want them to be orderable with a drag & drop feature. Here is my code: import { __ } from '@wordpress/i18n'; import { registerBlockType } from '@wordpress/blocks'; import { Draggable, Dashicon } from '@wordpress/components'; …
I am currently playing around with different CNN and LSTM model architectures for my multivariate time series classification problem. I can achieve validation accuracy of better than 50 %. I would like to lock down an exact architecture at some stage instead of experimenting endlessly. In order to decide this, I want to also tune my hyperparameters. Question: How do I balance the need to experiment with different models, such as standalone CNN and CNN with LSTM against hyperparameter tuning? …
I am doing a lot of work with transfer learning at the moment (using keras and tensorflow if that is relevant). I am having a lot of issues in sufficiently summarizing the very large models. This post: How do you visualize neural network architectures? shows a lot of useful methods for visualizing architectures, and they are great for networks such VGG16, but none of them are reasonable to include in a report if the models are very large (such as …
I want to modify the output of wp_link_pages. Basically what I need is to show Previous and Next buttons and current page/total number of pages. I created the Previous and Next button. Now in between them I want to add a current page and the total pages number. Here is my code wp_link_pages( array( 'before' => '<div class="page-links">' . __(''), 'after' => '</div>', 'next_or_number' => 'next', 'nextpagelink' => __('Next'), 'previouspagelink' => __('Previous'), 'pagelink' => '%', 'echo' => 1, ) ); …
So I have a dataset spread over multiple and ever-growing excel files all of which looks like: email order_ID order_date [email protected] 1234 23-Mar-2021 [email protected] 1235 23-Mar-2021 [email protected] 1236 23-Mar-2021 [email protected] 1237 24-Mar-2021 [email protected] 1238 28-Mar-2021 End goal is to have two distinct datasets as: First one being Orders: (Public. For analysis, trading emails with user_IDs for anonymity and marking returning for further analyses) user_ID order_ID order_date is_returning? 1 1234 23-Mar-2021 0 2 1235 23-Mar-2021 0 2 1236 23-Mar-2021 1 1 …
I'm trying to re-write permalink structure with my own custom url in WordPress for a Divi Theme "project" I have already changed the "Divi slug" from "project" to "prodotti" so currently, the URL appears like this: http://www.example.com/prodotti/%postname%/ with my custom function function custom_post_name() { return array( 'feeds' => true, 'slug' => 'prodotti', 'with_front' => false, ); } add_filter('et_project_posttype_rewrite_args', 'custom_post_name'); I want to add to these urls a variable, that reside for each post in post_metadata, in order to build a …
I am currently reading this paper on isolation forests. In the section about the score function, they mention the following. For context, $h(x)$ is definded as the path length of a data point traversing an iTree, and $n$ is the sample size used to grow the iTree. The difficulty in deriving such a score from $h(x)$ is that while the maximum possible height of iTree grows in the order of $n$, the average height grows in the order of $log(n)$. …
I need to provide a list of all options set via plugins etc to remote calls. There is a plugin WP API Options but it hardly does the job. There are two possible ways (that I know of) to get a list of all options set in the blog/site: Use $wpdb to run a query like so: $option_names = $wpdb->get_col( "SELECT DISTINCT option_name FROM $wpdb->options WHERE option_name NOT LIKE '_transient_%'" ); Use wp_load_alloptions() Which one of these two would be …
After updating woocommerce to latest version 6.5.1. i'm unable to order products because of: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data casued by checkout.min.js screenshots here: https://i.stack.imgur.com/JAf4D.png https://i.stack.imgur.com/11Vvg.png I tried to deactivate all plugins and after deactivating one of them i managed to finish order but orded did not containt ordered product. I just got customer info without product info. Debug.log wasn't helpfull because it showed me only the warning about that one plugin. …
I have a problem with pagination on my front page. I want to show all posts from a specific category and paginate them. Here is the code if ( is_front_page() ) { $paged = get_query_var( 'page' ) ? get_query_var( 'page' ) : 1; $args = array( 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 1, 'cat' => '4', 'page' => $paged, ); $q = new WP_Query( $args ); if ( $q->have_posts() ) { while ( $q->have_posts() ) …
I uploaded my first wordpress website on the server, but trying to add new media files, i have got the message "Missing a temporary folder", I tried the solutions on the forum: define('WP_TEMP_DIR',dirname(__FILE__).'/wp-content/temp/'); and created a 'temp' folder on 'wp-content', but the problem still happened .. how to fix that please ?? I tried by doing this : creating the folder on localhost with writable property then upload it to the server, but it still doesn't work
I am trying to build a predictive churn model that will identify customers who are likely to churn. I am defining a churned user as someone who hasn't transacted within 60 days. 90% of all transactions occur within 60 days of one another so this feels reasonable. I have very limited behavioural data; however. I have a record of a user's transactions and I have access to Google Analytics (GA). GA does not, however, allow me to track the specific …
I am trying to understand why the learning rate does not work universally. I have two different data sets and have tested out three learning rates 0.001 ,0.01 and 0.1 . For the first data set, I was able to achieve results for all learning rates at optimization using stochastic gradient descent. For the second data set the learning rate 0.1 did not converge. I understand the logic behind it overshooting the gradients, however, I'm failing to understand why this …
I am creating a Wordpress page where all my posts in the child categories of team are displayed in a grid. I got this working with the below code. The formatting and general layout is great however it only shows the 5 most recent posts in the child category instead of all of them. In my Wordpress account I have 7 posts which should be displaying. How should I retrieve the posts so it displays them all. <ul class="faces"> <?php …
For something we are working on, we were looking for a simple way to compare from review/feedback data against a question (for which there are multiple responses from multiple people), the following: What are the common things (things defined as phrases/sentences) they are saying (Some way to quantify the commonality too if possible). The point is to identify what seems to be areas of agreement about their review What are things that are not common (basically...what are those on-off sentences/phrases …
Simple task, but it isn't working: <?php $content = apply_filters( 'the_content', get_the_content() ); $contentWithoutHTML = wp_strip_all_tags($content); $pos = strpos($contentWithoutHTML, " ", 100); $contentFinal = substr($contentWithoutHTML,0,$pos ); echo $contentFinal . "..."; ?> My post is way over 100 characters long (with spaces), and yet I get strpos(): Offset not contained in string error, which leads me to believe it isn't actually pulling the entire content string. But I applied filters like I believe I should... please assist. Also sometimes even if …
To further explain my question. I am implementing 2 models. 1 is for action recognition and the 2nd is for weapon recognition. If there is a situation where a person is punching or kicking someone and carrying a weapon, my model should be able to detect the action and also a weapon, if that person is carrying any weapon in hand simultaneously. This can be useful for security purposes. So I want to combine these 2 models so that it …
When writing a paper / making a presentation about a topic which is about neural networks, one usually visualizes the networks architecture. What are good / simple ways to visualize common architectures automatically?
I want to train a network with mBART model in google colab , but I got the message of RuntimeError: CUDA out of memory. Tried to allocate 886.00 MiB (GPU 0; 15.90 GiB total capacity; 13.32 GiB already allocated; 809.75 MiB free; 14.30 GiB reserved in total by PyTorch) I subscribed with GPU in colab. I tried to use 128 or 64 for The maximum total input sequence length. Kindly, What can I do to fix the problem?
I need to parse widget content based on it's ID. But a widget works like a function that pulls data based on it's arguments, right? So when I pull the widget data, I can only get it's arguments, not the actual output. How can I parse the widget content based on it's ID? Example code: // Update widget rounds automatically function automatize_games_rounds($instance, $widget, $args){ // Check if there is a caption if (isset($instance['caption']) && !empty($instance['caption'])) { // If there is, …
I would like to change wordpress feed url. After a little research I find this function (check below). function remove_feed( $feedname ) { global $wp_rewrite; if ( in_array( $feedname, $wp_rewrite->feeds ) ) { $wp_rewrite->feeds = array_diff( $wp_rewrite->feeds, array( $feedname ) ); } $hook = 'do_feed_' . $feedname; // Remove default function hook remove_all_actions( $hook ); add_action( $hook, $hook ); return $hook; } But I don't know how to use this function. Is there any one who can explain it?
I need to change the default rss url of my website: from example.com/feed to example.com/MyfeedName Update: what i tried so far is to create another Url feed but i need to remove firstexample.com/feed: add_action( 'init', function() { add_feed( 'secretfeed', 'do_feed_rss2' ); }); add_action( 'pre_get_posts', function( \WP_Query $q ) { if( $q->is_feed( 'secretfeed' ) ) add_filter( 'option_rss_use_excerpt', '__return_false' ); } ); do you have any idea how to just edit example.com/feed or how to delete it without losing rss functions?
I have a dataset which contains ~15 features. With the elbow method, I found out that the optimal number of clusters is probably four. Therefore, I applied the K-means algorithm with four clusters. Now, I would like to understand why these clusters have been formed the way they are. In other words, I would like to identify the shared properties of the points of a specific cluster. My idea is the following: Let's pretend that C1 are the coordinates of …
I have installed XAMPP server and bitnami WordPress on my Ubuntu machine. I want to run a WordPress on my localhost but the following error occurs: Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.25 (Unix) OpenSSL/1.0.2j PHP/5.6.30 mod_perl/2.0.8-dev Perl/v5.16.3