Hot to check if new posts have been published since page load and notify online users?
Hot to check if new posts have been published since page load and notify online users?
Hot to check if new posts have been published since page load and notify online users?
Using Ajax to submit a form, and run a SQL Select query based on user input from the form
Hook on file upload
enqueuing external and internal js and css in wordpress did not work with owl.js animate.css
I finally solved it like this: var registerPlugin = wp.plugins.registerPlugin; var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel; var Button = wp.components.Button; var el = wp.element.createElement; var __ = wp.i18n.__; function onButtonClick() { alert( ‘Button is clicked’ ); } function MyDocumentSettingPlugin() { return el( PluginDocumentSettingPanel, { name: ‘my-document-setting-plugin’, title: ‘My Panel’, icon: ‘dashicon-name’, }, __( ‘My Document Setting Panel … Read more
You can follow below steps: HTMl Code: <button id=”clickMe” data-nonce=”<?php echo esc_attr( wp_create_nonce( ‘my-nonce’ ) ); ?>”>Click Me</button> PHP Code: here you need to use wp_ajax hook. class myFunctions{ public function __construct(){ add_action( ‘wp_ajax_clickme’, [$this, ‘ajax_callback’]); // for logged in user only add_action( ‘wp_ajax_nopriv_clickme’, [$this, ‘ajax_callback’]); // for non logged user only } public function … Read more
Never mind! I managed to come up with a solution. function insert_location(){ ob_start(); ?> <select name=”location” id=”location” class=”postform”> <?php $tax_terms = get_terms(‘location’, array(‘hide_empty’ => ‘0’)); foreach ( $tax_terms as $tax_term ): echo ‘<option value=”-1″>Select a Location</option><option class=”level-0″ value=”‘.get_term_link($tax_term).'”>’.$tax_term->name.'</option>’; endforeach; ?> </select> <script type=”text/javascript”> /* <![CDATA[ */ (function() { var dropdown = document.getElementById( “location” ); function … Read more
Currently your comment markup looks similar to the following: <li class=”comment byuser comment-author-rcotwunite odd alt thread-odd thread-alt depth-1″ id=”comment-7902″> <div id=”div-comment-7902″ class=”comment-body”> <div class=”comment-author vcard”><!– … –></div> <div class=”comment-meta commentmetadata”><!– … –></div> <div class=”filterDiv SELL show”> <div class=”container”> <p class=”wantosec”>I want to SELL</p> <p>SUP YALL im here to sell some stuff</p> <div class=”reply”><!– … –></div> … Read more
Get localize of a loaded javascript
Going by the js you provided you can just do this if ((screen.width <= 800) && (document.location=”https://example.com/”)) { location.href = “https:example.com/m-home-page/”; } You could also do this more dynamically using async request but if this solution is enough for you atm then go with it first.