I have the following code for a two-column container: <div class="rh_content rh_content_above_footer rh_page__content"> <div class="wp-container-3 wp-block-columns"> <div class="wp-container-1 wp-block-column"> <h2 style="font-size: 19px;color: #36a8fc;">Trouvez à Altea l’appartement répondant à tous vos critères</h2> <p>Souhaitez-vous une, deux ou trois chambres&nbsp;? Plutôt vue sur l’extraordinaire arrière-pays, ou sur la mer&nbsp;? Votre rêve, c’est plutôt terrasse ou jardin privatif&nbsp;? Et côté architecture&nbsp;? Votre préférence va-t-elle vers le style méditerranéen typique, ou vers une architecture résolument moderne&nbsp;? Comme vous le voyez, de nombreux choix sont possibles.</p> …
I am creating a like system in PHP . My code looks like this . <?php class Like_System { private $userid; private $postid; private $user_ko_like_count; private $post_ko_like_count; private $user_ko_dislike_count; private $post_ko_dislike_count; private $user_ip; public function __construct(){ } public function our_ajax_script(){ wp_enqueue_script( 'sb_like_post', get_template_directory_uri().'/data/js/post-like.min.js', false, '1.0', 1 ); wp_localize_script( 'sb_like_post', 'ajax_var', array( 'url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'like_system' ) ) ); } public function load_our_ajax_script(){ add_action( 'init', array($this,"our_ajax_script") ); add_action( 'wp_ajax_nopriv_like_system',array($this,"like_dislike_kernal")); add_action( 'wp_ajax_like_system',array($this,"like_dislike_kernal")); } public function verify_nonce($nonce){ if …
I have custom table like this: useraw 1. id (Primary*) 2. user_ip 3. post_id 4. time I am inserting data in the table using $wpdb->insert($table_name , array('user_ip' => $user_ip, 'post_id' => $postID, 'time' => $visittime),array('%s','%d', '%d') ); There are four rows I inserted using this code: id : 245 user_ip : 245.346.234.22 post_id : 24434 time : 255464 id : 345 user_ip : 245.346.234.22 post_id : 23456 time : 23467 id : 567 user_ip : 245.346.234.22 post_id : 57436 time …
On a wordpress index page, I am only allowed to add 12 galleries. I would like to add many more. Is there a way that I can expand the gallery limit allowed on index pages? If this is not possible, is there a way that I can add multiple index pages to a folder page? Thank you for any help
The project I am working is to create a platform,where every items posted can be exchanged for 1 token, instead of paying prices. To do this, I`ve tried YITH /SUMO /Woocommerce reward points plugins, and Dokan as the multi-vendor plugin. Here are the problems I encountered: Among all the reward points plugins, SUMO reward point is closest to my needs, as it provide payment gateway using award points. However,in each reward points plugins I tried,points-payment is just a converted version …
I am trying to fetch all direct children of a page. But I am getting all children and grand children as well. Any ideas? PHP Source: $args = array( 'child_of' => $post->ID, 'parent ' => $post->ID, 'hierarchical' => 0, 'sort_column' => 'menu_order', 'sort_order' => 'asc' ); $mypages = get_pages( $args ); foreach( $mypages as $post ) { $post_tempalte = the_page_template_part(); get_template_part( 'content' , $post_tempalte ); } My $args should be correct according to the documentation, but it's totally ignoring parent …
I am trying to insert some ad code in a site after X number of elements. The base code I am using was from using tags (from: http://www.wpbeginner.com/wp-tutorials/how-to-insert-ads-within-your-post-content-in-wordpress/): function prefix_insert_after_list_item( $insertion, $paragraph_id, $content ) { $closing_p = '</p>'; $paragraphs = explode( $closing_p, $content ); var_dump($paragraphs); foreach ($paragraphs as $index => $paragraph) { if ( trim( $paragraph ) ) { $paragraphs[$index] .= $closing_p; } if ( $paragraph_id == $index + 1 ) { $paragraphs[$index] .= $insertion; } } return implode( '', …
Hello I made a custom theme and moved it from MAMP to a cloud server. For some reason the CSS is an empty file. File path is correct, checked the file in cPanel and it has the full .css sheet. But when I go to console and follow the path it is just empty. My .js file loads fine and I beleive i enqueued the paths properly. Any help is greatly appreciated and thank you for your time! Functions <?php …
I have to make calls to multiple pages of a Woocommerce product database (getting all products in one go seems to not be an option), and the looping and collection of the results isn't working as I expect. I should see an array with just under 900 objects, but all I'm seeing is an empty array. I'm very new to PHP. THe relevant code below: function get_awesome_products() { for ($count = 1; $count <= 9; $count++ ) { if ($count …
I have 10 or more input hidden in 10 or more pages with different values in Wordpress text editor and I want to get the value using $_POST in a custom page template. How to do this? I tried to called the input hidden name in my custom page template but the value is not getting. Text editor <form method="POST"> <input type="hidden" name="segment" value="test"/> </form> Custom page template $segment = isset($_POST['segment']) ? $_POST['segment'] : '';
Is there any way through which I can declare the dynamic variable in php. for eg, I am using a for loop and the variable name is $message. and I want to add some dynamic data at the end of the variable name. code is below foreach ($quant as $quantity) { $message.$quantity['type'] = 'Listing ID : '.$quantity['product_id'].' With Quantity: '.$quantity['quantity'].'MT, State- '.$quantity['state_name'].' and Coal type-'.$quantity['coal_type'].'<br>'; } so if the $quantity['type'] = 1, then the variable name should be $message1 and …
I am unable to find an answer to this so I'm trying my luck here. Is there a way to get the coauthor the moment it's added as a coauthor? I want to trigger an event exactly when the author gets added.
How to show tax percentage for each item in order in an xml. i create xml when order is paid. but need to show item tax labels for each items for example. "7% Mswt", "19% Mswt". function get_line_items( $order ) { $items = []; /** @var \WC_Order_Item_Product $line_items */ $line_items = $order->get_items( 'line_item' ); // loop through each item in order foreach ( $line_items as $item_id => $item ) { // get the product /** @var \WC_Product $product */ $product …
I'm using blogstart wordpress theme and I would like to change "Read more" text to something similar to language than I'm using. How can I do that? I already tried to paste code below to functions.php. Replaces the excerpt "Read More" text by a link function modify_read_more_link() { return '<a class="read-article" href="' . get_permalink() . '">Your Read More Link Text</a>'; } add_filter( 'the_content_more_link', 'modify_read_more_link' ); // Replaces the excerpt "Read More" text by a link function new_excerpt_more($more) { global $post; …
I recently worked on this website : https://semaine.com/ But since some time the content of the pages https://semaine.com/classroom/ and https://semaine.com/cinema/ are not displayed anymore. The pages load, the navbar and the footer are there but not the content. It works locally on my computer with MAMP but not online. I tried several things like disabling various plugins, re-generating links, restoring the theme from my local version, ... Here is the content of the cinema.php file: <?php /** * Template Name: …
I'm using array_map to sort out an array with all of my _octopud_id's. var_dump($offices): Returns the following: array (size=500) 0 => array (size=1) 'id' => string '1382' (length=4) 1 => array (size=1) 'id' => string '1330' (length=4) I need to input that array integer into the 'employees/' section but I can't figure out how - If I hardcode employees/6 I get the following result: object(stdClass)[14592] public 'id' => int 6 What could I be doing wrong? I keep getting the …
Hello Wordpress Developers. I create my own plugins, and I'm stuck about how to call php functions inside class, into javascript ajax functions. For example we have button with ID name clickme: <button id="clickMe">Click Me</button> And then I make a class with functions, example like this: <?php class myFunctions{ function a(){ $test = "Hello World from wp_send_json()"; wp_send_json($test); } } ?> and then I want to output the test variable, using ajax. Example like this: import $ from "jquery"; class …
I'm working on a WooCommerce webshop. I have divided all my products into categories. Example: Clothing: -Tshirts -Jeans -Etc. Likewise, all brands are also divided into categories. Example: Brands -Brand1 -Brand2 -Etc. I want to copy or mirror the category and sub-categories of "Brands" to a custom taxonomy. So when I have a product in the "Brand 1" category, then this product must be automatically entered into a custom taxonoy with the same name: "Brand 1" The products in woocommerce …
I have a custom field in post_meta table of wordpress database. It's called 'combined'. I want to seperate the values based on key and save them as multiple rows if there are multiple values for the key. My meta_key: Result after I run my code: What I want: My code: add_action( 'init', function() { if ( 'migrate' !== filter_input( INPUT_GET, 'action' ) ) { return; } $query = new WP_Query( [ 'no_found_rows' => true, 'update_post_term_cache' => false, 'fields' => 'ids', …