Can I do in-page changes binding events/triggers to actions in WordPress?

I've been coder for decades but I need to setup some microsites super-fast. I chose WordPress as the platform and I'm complete newbie to WordPress. The behaviour I need I know can do it programming. But the question is if this can be done "zero-code" in WordPress: Question Can I bind in-page "triggers" to "actions" natively in WordPress? Examples Whenever a user scrolls more than 80%, a new button is added. Whenever a user watches an embedded video hosted in …
Category: Web

How to make a dataframe with lists or vectors as its elements

This is something I have been wondering for ages but I am never able to get an answer. I am trying to understand how to make a dataframe in R, where each element of the dataframe is itself a vector or a matrix. For example, lets say we have a regular vector V with elements being real numbers. Then to acess any number we would have V[3] which would give the third element of said vector. Now I want to …
Topic: code data r
Category: Data Science

admin-ajax.php 400 bad request - whats wrong with my code?

I'm getting a 400 bad request from admin-ajax.php & warnings from pagespeed insights tell me it's an issue. Can you see any obvious issues in the code in our admin-ajax.php file? <?php /** * WordPress Ajax Process Execution * * @package WordPress * @subpackage Administration * * @link https://codex.wordpress.org/AJAX_in_Plugins */ /** * Executing Ajax process. * * @since 2.1.0 */ define( 'DOING_AJAX', true ); if ( ! defined( 'WP_ADMIN' ) ) { define( 'WP_ADMIN', true ); } /** Load WordPress …
Category: Web

Display a specific category in a focused area of my site

I've been trying to change the code of my WordPress site. Rather than showing "trending posts" which is determined by post_views_count, I simply want to show posts from a certain category. The code, as it stands is: if ( !function_exists( 'getCrunchifyPostViews' ) ) { function getCrunchifyPostViews($postID){ $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); return "0 View"; } return $count.' Views'; } } if ( !function_exists( 'setCrunchifyPostViews' ) ) { function setCrunchifyPostViews($postID) { $count_key …
Category: Web

Counting number of posts in multiple (sub)categories using shortcode

I'm making a new cycling team website and on the home page i have 3 different type of stats: "Win, Podium and top-10" Now i want the number of the stat go up if i post something with for instance the category: "Podium" But i want it to go 2 up if i select the categories: "1-podium / 2-podium" ETC So in short, i want the count number go up if i post something while selecting one or more categories. …
Category: Web

Including Angle Brackets In Pre Sections

I am attempting to post some java code between pre tags but the angel brackets get removed. For example: private HashMap<String, HashMap<String, Integer>> featureCounts; becomes private HashMap> featureCounts; Is there a way I can render the actual code? Also I am not a php developer or a wordpress expert by any means, so modifying the underlying php would be less preferred as a solution. Is there a way I can do this just using the editor?
Category: Web

How to get tags and categories?

I used the following code to get tags from the post and then simply echo them: $posttags = get_the_tags($post->ID); if ($posttags) { foreach($posttags as $tag) { echo $tag->name . ', ';} } Now I need to get the categories as well. My first idea was to simply duplicate the function but isn't there a way to create one single function that'll retrieve both the tags and categories and then have it echo?
Category: Web

Need help for some PHP code

I've already set all the fields in my theme settings but I want that carousel-items class repeats whenever I add slides to it, and [0] changes to [1],[2],... <div class="carousel-items"> <a href="<?php echo website_TDU; ?>/single.html"> <div class="carousel-main-image"> <img src="<?php echo $main_slider[2] ['main_slider_main_image']; ?>" alt=""> </div> <div class="carousel-more-info"> <div class="game-name"><?php echo $main_slider[2] ['main_slider_title']; ?></div> <div class="screenshots"> <div style="background-image: url('<?php echo $main_slider[2] ['main_slider_thumbnails1']; ?>');"></div> <div style="background-image: url('<?php echo $main_slider[2] ['main_slider_thumbnails2']; ?>');"></div> <div style="background-image: url('<?php echo $main_slider[2] ['main_slider_thumbnails3']; ?>');"></div> <div style="background-image: url('<?php echo …
Category: Web

How do you find the logo code on theme file or where can I find the header theme file?

I am trying to find the header.php file and/or the code for the logo on any theme file. Under appearance- editor section of my website ( www.pithandsubstance.com ) I can only find function.php and style.php files. Please note : I am new to Wordpress and highly detailed instructions will be very appreciated. Thank you in advance, PS
Category: Web

code block does not show in excerpt

I am creating some blog pages with example codes, and I would like to show the codes in excerpts, but WordPress automatically excludes code blocks from excerpts, is there a workaround for showing code blocks in the excerpt?
Category: Web

Creating column of plot numbers using python

I try to make a code which returns the following values: 1101-1182,1201-1282,....1701-1782 2101-2182,2201-2282,...2701-2782 3101-3182,3201-3282,...3701-3782 the code will create a column of plot numbers for my wheat experiment. Cheers
Topic: code python
Category: Data Science

Why does HTML entities are still encoded in Code Block?

In the Code Block if I type in reversed character, they are encoded to HTML entities: Input: Output: <pre class="wp-block-code"><code>'[] </code></pre> Meanwhile, if I put them in the custom HTML block, the output characters aren't encode: Input: Output: <code>'[]</code> <code class="'[]"></code> <code><code class="'[]"></code></code> <pre class="wp-block-code"><code>'[]</code></pre> I wonder why this should be the case? I enable troubleshooting mode and use the Twenty Twenty-One theme. Related: Why does the custom HTML block not preserve the HTML characters?
Category: Web

Save Meta when custom Taxonomy Saves

I am in need of some advice, we are setting up a custom tag for Movies. We want to have it pull from the OMDB Api when it is saved. We have the function setup, but it is not firing, and I am stumped. I am trying to have this call when I save the custom taxonomy, so it populates the info needed for the details. Is there is something I am missing, please let me know, BugFu is reporting …
Category: Web

How i can remove Working Functionality of my header & footer plugin from backend files but in front end plugin need to show that plugin activate

I have a question actually I have a website in which one of my friends is using too many scripts in the header & footer using header & footer plugin in WordPress so I just want to stop the functionality of plugin from backend files but I want to show plugin works perfectly on the front but stop from the back end is there any way to do this please help... Thanks.
Category: Web

subtracting from multiple rows in a cvs file in python

I am trying to figure out how to subtract a set amount from a row if it goes over a value. For example, if I have a list of library accounts and I need to write a function whereby if an individual goes over their printing credits, they are charged an additional 0.10p. At the moment I have my columns with the library IDs and one with their account balance and limit they are allowed to go over. However, I'm …
Category: Data Science

How to save checkbox values for logged in users?

Hello~ How can I have checkboxes save their values for a logged in user? My Wordpress website features various checklists in a table format. When a user finishes a task on the list, they would be able to tick one of the boxes to signify completion. That value should then be saved to the database, either automatically or by clicking a save button. When the user returns to that page later on, the boxes that they selected should remain. [Page …
Category: Web

Woocommerce display orders with products from specific categories to specific admins

I am new at stackoverflow. I have a question about wordpress. I am building a wordpress site for some cinemas with movies. Each cinema is a product category. I want enable an admin cinema1 which will see only orders from his category. I used the addon user roll editor to disable cinema1 from all administration except orders. But I want to show him only orders for his cinema. So admin:cinema1 will see only orders with products from category:cinema1. Admin:cinema2 will …
Category: Web

Woocommerce template file outputting <strong><code> tags

I'm struggling with the editing of the woocommerce template files. In particular, I'm trying to create a custom cart page and, as guidelines, I've copied the cart.php template file to my template folder. However, any html that I write gets enclosed in &lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt; tags. I really don't understand why, does anybody have an idea? Here's an example: &lt;?php defined( 'ABSPATH' ) || exit; do_action( 'woocommerce_before_cart' ); ?&gt; &lt;div&gt;&lt;span&gt;hello&lt;/span&gt;&lt;/div&gt; It outputs &lt;strong&gt;&lt;code&gt;&lt;div&gt;&lt;span&gt;hello&lt;/span&gt;&lt;/div&gt;&lt;/code&gt;&lt;/strong&gt;
Category: Web

About

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