11
votes
Accepted
How to add "Insert/Edit link" button in custom popup tinymce window?
So I'm answering my own question, for those that face or will face the same problem.
I have added two buttons. One opens wordpress' build-in window to select a post and inserts the link. The other ...
7
votes
Display "add to cart" button on every listing in product category page?
You can use the WooCommerce hook woocommerce_after_add_to_cart_button. This hook will add content after the "Add To Cart" button.
If the customer clicks on this button, the product should ...
3
votes
Hook and send Woocommerce data after click Place Order button
For this three possibilities:
If you really want to do it on order place you would have to use the hook:
woocommerce_new_order
However I would recommend you use the hook:
...
3
votes
Accepted
Help add ajax load more button
Your div wrapper is within your while loop, and split by your if clause.
This cannot work properly, since your loop will generate up to 14 divs with the id ajax.
Put the opening div tag after if ( $...
3
votes
Accepted
How can I create custom button in post.php
Use media_buttons action for it. Check below code.
add_action('media_buttons', 'add_my_media_button');
function add_my_media_button(){
echo '<a href="'.get_site_url().'/wp-admin/customize.php" ...
3
votes
Accepted
How to align a single Gutenberg block button in WP 5.5.3?
select the entire 'buttons' block
once the entire buttons block is selected,
For future reference, the wordpress.com button article is usually current although it is currently out of date at the ...
3
votes
Remove border radius setting from the Gutenberg button block?
Create a theme.json file in the root of your theme, and add this inside:
{
"version": 1,
"settings": {
"blocks": {
"core/button": {
"...
3
votes
Button generate a random URL
It looks like your code works as written.
Alternatively, you can generate an alphanumeric string using uniqid()...
<a href="http://meet.jit.si/<?php echo uniqid()?>" target="...
3
votes
Custom button block doesn't work
I'd recommend looking at how the existing Button component works to get a sense of how Gutenberg does things. Specifically it uses a <RichText/> component (instead of a native <input>) ...
3
votes
Accepted
How can I make one button a different color from the other buttons on my site?
You probably need to add more specificity or more accurate targeting to override the existing block button styles. In the first case you are applying the styles to the .wp-block-button__link ...
2
votes
Accepted
Displaying a button on each post
Use the_content hook and hook only when you are on a single page:
add_filter( 'the_content', 'my_button_function' );
function my_button_function( $content ) {
// See if it's a single post or a ...
2
votes
How do I programatically empty trash?
This didn't work for me. I had to do the following:
$args = array(
'posts_per_page' => -1,
'post_status' => 'trash'
);
$trash = get_posts($args);
foreach($trash as $post)
{
...
2
votes
Accepted
How can I link a file in admin with a button?
Finally, I make it, the way without losing the access to WordPress environment:
add_action( 'edit_form_after_title', 'custom_button' );
function custom_button() {
$button = sprintf('<a href="%1$s" ...
2
votes
Accepted
WordPress comment submit button substitutes/options
The <a> tag is the wrong tag for a submit button. <input type="submit"> and <button> are designed for this purpose. An <a> tag won't even submit the form data. You need to ...
2
votes
<button> element not working in Safari
Try changing the z-index in the css of the button.
button#btn-show {
z-index: 10;
}
2
votes
Accepted
How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?
Here is a simple example from w3 schools that uses a bit of JS to copy the value of a input field.
<input type="text" value="StackExchange WordPress" id="myInput">
<button onclick="...
2
votes
Accepted
AJAX on Front-End Button Click not working - Custom Plugin
Ok, so it’s pretty easy error - just a typo ;)
You use this line to localize your script:
wp_localize_script( 'ajax-script', 'my_foobar_client', array(
'ajax_url' => admin_url( 'admin-ajax.php' )...
2
votes
Accepted
AJAX button action in foreach
This is happening because you have click event firing on ID
jQuery('#przyciskUlubione').click(function() {
The ID is always unique, there should never be more than one same ID in the HTML.
You can ...
2
votes
Accepted
Skewed / slanted button within elementor
What you need is to select Elementor buttons and add a simple custom CSS. Basically what you need to do is to skew the button with the negative value, and then skew the inner text element with the ...
2
votes
Download a file and scroll to bottom div on button click
Demo: 👉🏻 https://codepen.io/livehelp/pen/MWoNPqX?editors=1010
Just use an HTML or Code element in Elementor to paste in the code instead of a Button element.
<h2><a href="#smooth" ...
2
votes
Gutenberg Button Border Radius Default
This should theoretically work by defining the initial value in theme.json as shown in these examples https://gist.github.com/skorasaurus/d50ea7eb79d664775418492e46cef021 and https://github.com/...
2
votes
Accepted
Gutenberg Button Border Radius Default
WordPress 6.3 now has this option. Here is what you have to insert in theme.json :
{
"styles": {
"blocks": {
"core/button": {
&...
1
vote
Display "add to cart" button on every listing in product category page?
Here is simple solution for it.
$product_object = wc_get_product( $product_id );
echo '<a href="' . esc_url( $product_object->add_to_cart_url() ) . '" class="buy-now button"&...
1
vote
Accepted
Display "add to cart" button on every listing in product category page?
<a href="<?php the_permalink(); ?>" class="more">More info</a><?php
if($available){?><a href="<?php
$add_to_cart = do_shortcode('[add_to_cart_url id="'.$...
1
vote
Woocommerce - Remove 'Buy Product' Button from shop page
With an External/Affiliate product, if you leave the Product URL field empty, Woocommerce doesn't display the buy button. You could then add your own link to buy in the product's description. Add a ...
1
vote
How to insert a Button or custom text on twentyseventeen header
I'm guessing in involves PHP to the site-branding file, but not really sure.
yes it does. You to create a child theme based on the twentyseventeen theme, and add create a new custom header.php file ...
1
vote
CSS style button For WP Login Function in page template
You just need to add a function to style the login form:
function my_login_css() {
?>
<style type="text/css">
#wp-submit {
border-color: #777;
background: #999;
box-shadow: none;
...
1
vote
Accepted
add share buttons above my posts without plugins
Use This Code May Help You:
add_filter('the_content', 'br_content_with_social_buttons');
function br_content_with_social_buttons($content){
$url = urlencode(get_permalink());
// ...
1
vote
How to dynamically add the the input text field in widget?
How about jQuery append method?
To make a counter, simply increment i variable every click.
$('body').on('click', '.add-more-button', function() {
var i = 2;
$('.widget-input').append('<label&...
1
vote
Divi theme: change overlay color from default blue to back
Some CSS to change the attributes of the 'single_add_to_cart_button' CSS class (which is used for the button; I found that while using Firebug to inspect the button element).
....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
buttons × 215php × 21
tinymce × 21
plugins × 20
posts × 15
css × 15
woocommerce-offtopic × 14
ajax × 13
functions × 12
customization × 11
block-editor × 11
javascript × 10
plugin-development × 9
images × 9
jquery × 9
admin × 9
metabox × 9
menus × 8
shortcode × 8
links × 8
editor × 8
hooks × 7
pages × 6
forms × 6
media × 6