How to call shortcode on button click

You can’t add a shortcode to PHP directly. However, each shortcode executes a function, so you can just add that function to your link code. If your shortcode is something like this: function my_custom_shortcode( $atts, $content= NULL) { shortcode function } add_shortcode ( ‘my_custom_shortcode’ , ‘my_custom_shortcode’ ); use this in your link: <a href=”https://wordpress.stackexchange.com/questions/253796/<?php my_custom_shortcode(); … Read more

Custom Registration and Login Forms with reCaptcha 2 Validation

First connect the CAPTCHA script (add to: functions.php) function onwp_enqueue_frontend() { wp_enqueue_script(‘ha-recaptcha’, ‘https://www.google.com/recaptcha/api.js’, array(‘jquery’), ‘1.0’, true); } add_action(‘wp_enqueue_scripts’, ‘onwp_enqueue_frontend’); In the form of adding the following html code to display the captcha <div class=”g-recaptcha” data-sitekey=”YOU_SITE_CODE”></div> YOU_SITE_CODE – replaced by your code Next, add the CAPTCHA validation feature $recaptcha = $_POST[‘data’][‘g_recaptcha_response’]; if (!empty($recaptcha)) { $google_url = … Read more

Simple Probléme in wordpress

You’ll have to give a little more explanation. But I think that the problem is that you are using get_template_directory_uri() as an anchor link. What get_template_directory_uri() does is to give you the URL of your theme, for instance you can get your “/assets/images” folder like this. If your site structure is “theme_folder/page1.php” then I recommend … Read more

theme 2016 – customize css – nothing happens

Try viewing the page’s source code (ctrl + u, usually) to see if the code is actually being added to the <head> element of the web page. If it is, the problem is not with WordPress, but that you are probably targeting the wrong elements. If so, right-click on the item you are trying to … Read more

How can I completely edit the footer?

It all depends on the theme. Most themes will have a footer.php file somewhere, which usually contains code related to the wp_footer function. It may also be in the theme’s function.php file. It’s all dependent on the theme. You can change (add to) what happens with the wp_footer function, see here for a start https://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer … Read more

Duplicate post on publish

It’s a normal behaviour of WordPress if you have attachments in your post and revision enable for your site. When an attachment is added to a post, the attachment post_status is inherit of the parent post, and the logic is that the ping status is set to closed. When revisions are enable, a copy of … Read more

Twenty thirteen theme change the height of menu sub items

That would be in ‘style.css’ line 870 in the root folder of the theme, you can add height there: .nav-menu li { display: inline-block; position: relative; height: 80px; //you can add height here } i am not sure what are you trying to accomplish but i recommend to use the ‘a’ tag if you want … Read more

Why has my WordPress theme disappeared from my WordPress site?

As mentioned, you should never modify the code of a theme. You should always create a Child Theme that uses that theme. Info about Child Themes – start here https://developer.wordpress.org/themes/advanced-topics/child-themes/ Whenever a theme is updated by the theme author, it overwrites all of the theme code, including the changes you have made to the code. … Read more

i want to add pagination list of categories

<?php $args = array( ‘parent’ => 0, ‘hide_empty’ => 0 ); $categories = get_categories( $args ); echo $cat = ceil(count( $categories )/5); ?> <?php $j=0; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $posts_per_page = 5; $offset = ($posts_per_page * $paged) – 5 ; $args = array( ‘orderby’ => ‘name’, ‘parent’ => 0, ‘hide_empty’ => 0, … Read more