How to remove top menu item and font awesome icon in WordPress menu?

In my WordPress menu I have a top or header menu item. I know how to find it and use CSS to hide it, but that's not exactly what I want. At the moment I have menu bars which, when pressed, go to fa-angle-down and header menu item, which, when pressed, go to the actual menu. I'd like to remove this intermittent menu stage consisting of header menu item and fa-angle-down so that the user is taken straight from bars …
Category: Web

How to assign php file(template) to several pages with same prefix page name/slug

Can I assign WP php file (specific template) to several pages with same prefix name/slug using (if is_page(){}) ? If it's possible it could be useful. Is there a php function to do like css selector : [class*="activity-"] for example ??: if(is_page('[activity-]')){ include "activity.php"; } the goal is to not repeat 4 times the same function : if(is_page('activity-sport')){ include "activity.php"; } activity.php assign to : website/activity-sport website/activity-culture website/activity-charity website/activity-work
Category: Web

Why is the Page Title missing on Pages added with add_submenu_page?

Adding sub menus is easy with add_submenu_page and is working fine as long if you define a $parent_slug: add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); if you set the $parent_slug to NULL as described here to hide it from any menu item the title of the page will get ignored ($page_title) add_submenu_page( NULL, $page_title, $menu_title, $capability, $menu_slug, $function ); I've tested it with all versions from 3.3 up to the latest 4.0
Category: Web

Anomaly Detection

I have a problem where I want to identify Vendors with unusual high amount invoices. What would be the best way to identify such invoices? I am trying to use Isolation Forest but having trouble in grouping by the result by Vendor. Any help will be appreciated. Data is in below format . Vendor ID Amount 1 456 2 1000 1 489 3 896 2 4576
Category: Data Science

Restrictions on my skewed validation data

I have a severely skewed data sets consisting of 20 something classes where the smallest class contains on the order of 1000 samples and the largest several millions. Regarding the validation data, I understand that I should make sure that it represent a similar ratio between classes compared to the one in my original raw data. Hence, I shouldn't do any under- or over-sampling on that validation data, but can do it on the training data. Because I have such …
Category: Data Science

Dynamic dependent Dropdown lists for categories, sub-categories and posts

I'm using WordPress 3.5. I need a way to implement a code or plugin to allow users to navigate through posts using dependent(chained) dropdown lists. In other words I would like 3 dropdown menus to be dynamically populated based on the selection chosen in the previous dropdown lists. This would consist of: Dropdown 1: Category* Dropdown 2: Sub- Category* Dropdown 3: List of posts in Sub-Category* *Dropdown 1 would be pre populated with categories. *Dropdown 2 would list the sub …
Category: Web

How to interpret a linear regression effects graph?

could someone tell me how to interpret the following graph? It corresponds to a graph in which the effects of the variables in a linear regression are observed, but its interpretation is not clear to me. Why in working day only half a graph is shown? Why doesn't weathersit have whiskers? Why holiday is simply a line at 0? Here is a brief summary of the variables: workingday : if day is neither weekend nor holiday is 1, otherwise is …
Category: Data Science

Treating highly correlated features to the label feature

We work on a dataset with >1k features, where some elements are temporal/non-linear aggregations of other features. e.g., one feature might be the salary s, where the other is the mean salary of four months (s_4_m). We try to predict which employees are more likely to get a raise by applying a regression model on the salary. Still, our models are extremly biased toward features like s_4_m, which are highly correlated to the label feature. Are there best practices for …
Category: Data Science

How to prepare Audio-text data for speech recognition

I have gathered some raw audio from all the conferences, meetings, lectures & casual conversation that I was part of. The machine transcription did not offer good results (from Azure, AWS etc.) I would transcribe it so to have both data+label (audio+text) for ML training. My question is whether to have small (3-10 sec.) audio files (split it at silence) and then transcribe each small file? or large file with timestamps with subtitle.srt format? What if I have a long …
Category: Data Science

Custom post status

I am trying to work out how to add a set of new publish statuses to custom post types in wordpress as I would like to do the following: User signs in and uses the custom post type to fill in the information fields upon completion the post type should be set to awaiting approval and only viewable but not editable by the user then an admin should be able to set the status of approved (user can then not …
Category: Web

Best place to keep files that are called by cron jobs?

I am interesting in setting up a Wordpress Website which needs to keep updating certain custom database tables after fetching data from RESTful Web Services, lets say once in a day. I can achieve this by having a script to make request to REST API, process data and then store it into required tables. However, I am not sure where to put this script file so cron can call it without any issues (security wise) Can I place these script …
Category: Web

Dynamically insert code to custom post type loop

I need to display post from custom post type name "film", from a specific taxonomy "Horror." Everything work fine when I type the taxonomy directly like this: <?php $blog = array( 'post_type' => 'film', 'catfilm' => 'Horror', 'post_status' => 'publish', 'posts_per_page' =>4, 'ignore_sticky_posts' => 1, ); ?> I need to insert dynamically the taxonomy with CMB2, so I change the code like this, but no luck. The post failed to appear: My CMB2 function: $cmb_tvseries->add_field( array( 'name' => esc_html__( 'type …
Category: Web

Interpreting Homoscedasticity and Residual spread for linear regression

I am new to Data analytics. I have difficulties of understanding what both the Homoscedasticity and residual histogram is trying to convey. Please any help is appreciated. I have a linear regression checking for relationship between the age of shoppers and their rating of products (1-5). I am to check data assumptions for homoscedasticity and residual. i have the below graphs plotted with r after building the model. Please what do these readings mean?
Category: Data Science

Using the first 3 layers of a pretrained network in Keras

I want to use the 3rd layer's output of the VGG16 network. The error is like below: UserWarning: Model inputs must come from `keras.layers.Input` (thus holding past layer metadata), they cannot be the output of a previous non-Input layer. Here, a tensor specified as input to your model was not an Input tensor, it was generated by layer input_1. Note that input tensors are instantiated via `tensor = keras.layers.Input(shape)`. The tensor that caused the issue was: input_1:0 str(x.name)) Traceback (most …
Category: Data Science

Fuzzily join two large sets of postal addresses

I have two tables of postal address information - the one is about 2 million records, the other roughly 40 million. They have quite bad quality, and also are not quite compatible with each other (different conventions in both sets, some fields cut off in an impractical way... - in other words, Real World Data). They may not be the largest ones around, but compared to the available hardware, they are non-trivial (I cannot simply spin up a lot of …
Category: Data Science

How to stop your plugin from executing on certain pages?

I'm building a plugin that extends WooCommerce and I want to prevent it from executing once it hits the template_redirect hook. My goal is to stop the plugin from loading all the assets on non-product pages. Any ideas on how to do this? Code add_action('template_redirect', array($this, 'stoplight')); function stoplight() { $post_type = get_post_type(); if ($post_type != 'product') { return; //I used wp_die() here as well, but it killed WordPress. } }
Category: Web

What does exactly GPL license mean for my WordPress theme?

To put it like this: I have created a WordPress theme for myself which consists of the following: PHP code - GPL v2 licensed like WordPress CSS files - All rights reserved JS files - All rights reserved image files required for the theme - All rights reserved As far as I understand I can copyright all non PHP files in the theme, so my question is: Does this licensing scheme (for file groups) violates the WordPress license? Do I …
Category: Web

Symbolic link for uploads in wordpress

Hi i am a new bie in wordpress. i use load balancer for my sites. So the request can be processed by any of the 4 servers. so i moved all contents from /wp-content/uploads to the centralised server /images/myblog/wp-content/uploads and created a symbolic link to it. Now the problem is, access to media contents results in 404 error. Can you please explain, is anything i am missing out.
Category: Web

How to create group IDs for people in longitudinal data

I have a large data set which contains individuals and the address where they live. I want to create a group ID based off shared addresses (the working idea: people who share the same address can be considered as part of the same family/household). And from that household ID, my PI wants to investigate households/families migration overtime due to cost of living increases/decreases. However, the difficulty is the dataset/analysis is longitudinal. So we have this data set spanning multiple consecutive …
Category: Data Science

Integration of NLP and Angular application

I'm doing a small POC in which I've trained my Machine Learning model (Naive Bayes) and is saved in ".pkl" (pickle) format. Now my next task is to develop a web application which asks the user to enter the Text for the Text classification analysis. This newly taken (from the user) "TEXT" will be the testing dataset which can be fed to the Naive Bayes model that I built in the earlier stage and make prediction on the "text" taken …
Category: Data Science

Time series test data dilema

I’m trying to build a model to predict the amount of sales of a product for the next few days This question is about whether or not I should use the tail of the serie as the test set and train models using the rest of the data or I should create a test set picking dates at random as usual Reading about classical time series models (ARIMA), they recommend the first approach (using the last days as test) but …
Category: Data Science

How to create sub site in wordpress multisite programmatically?

I have wordpress multisite created. Now I want to create a 10 sub sites automatic/programmatically. I have created one form and that form is uploaded on the same server. So once the user filled out that form and the subsite needs to be create automatic. If you have any article, plugin, code or script please help me. Thank you in advance.
Category: Web

Broken link additional images after moving server

Recently we moved the website of our client to a new server, and in doing so the links to almost all the images were broken. I've been able to fix the majority of them, but somehow in the woocommerce, it's not showing additional images. At first it wasn't even showing the primary image, but I was able to solve that by fixing the links in the database. The aditional images however are still not loading. Using a product feed plugin …
Category: Web

Distribution of Regression Residuals: Is this a normal distribution?

I've created a histogram as well as a QQPlot from the residuals of my Regression Model: Mean: 0.35 Standard Deviation: 18.14 Judging from these plots, is it okay to say that my residuals are normally distributed? Or what else can I draw from these plots? Update: Created the Histogram using ns.distplot(x, hist=True) Here's the result:
Category: Data Science

Similarity Matching Algorithm

I am looking for help on identifying a class of algorithm. If I have a tabular training and test set I want to know the similarity of rows based on some numeric features. The training data would be labelled such that rows would be paired (or even grouped). The output for each row in the test/prediction set would be the most similar row and the probability that it would have been paired with that row. In theory there could be …
Category: Data Science

Wordpress - Portfolio - Change number of items in a row

I am using the Pure theme. Instead of having five (5) items per row in the portfolio, I want to have four (4). How could I customize the theme's CSS? To build the page, I am using the portfolio module of the GT3 Page Builder.The CSS is below: /* Portfolio */ .optionset { margin: 0; padding-left: 0; text-align: center; line-height: 13px; } .optionset li { list-style: none; margin-left: 0 !important; margin-right: 30px; display: inline-block; line-height: 13px; } .optionset li:last-child { …
Topic: css Wordpress
Category: Web

binary classification pipeline to select threshold

There are quite a few questions regarding the optimisation of binary threshold in a classification problem. However, I haven't found a single end-to-end solution to this problem. In an existing project, I have come up with the following pipeline to train a binary classifier: Outer-CV due to small to moderate data size. Inner-CV to tune hyperparameters Train model with tuned hyperparameters on outer-cv trainset Predict on the outer-cv test set Find optimal threshold using prediction probabilities Get score converting prediction …
Category: Data Science

How to change custom post order ASC/DESC menu_order wise dynamically?

I have created custom post type in back end with sort menu_order post as you can see in the screenshot. http://prntscr.com/gacw95 In back end sorting ASCENDING/DESCENDING working fine. But I need to Sort ASC/DESC on the front side also. When I click on order tab in back end It will be sorting the post in back end but not in front end. How can I sort the custom post in front side when change in the back end? Backend code …
Category: Web

Moving to a new domain in the same server

I recently adquired a new domain I would like to use for my old wordpress site. I managed to configure this new domain in the same server and pointing to the main page. However, after changing the Wordpress URL and website URL fields under Settings, the layout for the site breaks. It's like the theme I'm using gets corrupted. What is the correct way of switching from one domain to another? I looked at http://codex.wordpress.org/Moving_WordPress but this doesn't mention the …
Category: Web

Woocommerce. Get a list of products in the current category on the archive page and product page

I'm trying to create a small code that will display a list of discounted products that belong only to the category of products that the user is on, that is, if the user is on the clothing category page, then the code should display only discounted products from the clothing category, I also want the code to work on the product page. For now, here's what I got. $args = array( 'post_type' => 'product', 'posts_per_page' => '5', 'product_cat' => 'clothes', …
Category: Web

Unzip file in functions.php, and add it to cron

I have a file in the root folder of my wordpress installation (myfolder, wp-content, wp-config, and all other). I want unzip a test.zip archive in my myfolder folder in root directory. I try this function on my theme functions.php : add_action( 'test_unzip', 'unzip_folder' ); function unzip_folder() { WP_Filesystem(); $destination = '../myfolder/'; $destination_path = $destination['path']; unzip_file( $destination_path.'/test.zip', $destination_path); } I add the action in cron to do it every 3 hours, and also to try my code. It's not work and …
Category: Web

How does an RNN differ from a CBOW model

CBOW: We are trying to predict the next word based on the context (defined as a certain window of words around the target word) RNN can also be used for predicting the next word in a sequence, where each time the input is the present input and the recent past (i.e. output of the previous step) I am not able to understand how the RNN's approach is somehow better, because I could define a very large window for CBOW, and …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.