How to add a new button on post

in the free theme Customizr, you can add content after the edit link with this code in the file functions.php of the child theme add_action(“__after_regular_heading_title”, function () { $post = $GLOBALS[“post”]; ?> <span> an addition after the link to edit “<?php echo htmlspecialchars($post->post_title);?>” </span> <?php });

Admin Bar – Customizer Label Change

You can use the get_node function and admin_bar_menu action. Like so, function edit_customizer_node( $wp_admin_bar ) { $customize = $wp_admin_bar->get_node( ‘customize’ ); if ( $customize ) { $customize->title = __( ‘Customize Theme’, ‘text-domain’ ); $wp_admin_bar->remove_node( ‘customize’ ); $wp_admin_bar->add_node( $customize ); } } add_action( ‘admin_bar_menu’, ‘edit_customizer_node’, 999 ); This can be placed in your theme’s functions.php file. … Read more

How to update the children of a post?

get_children returns an array of post objects by default: https://developer.wordpress.org/reference/functions/get_children/ So you would have to use ‘ID’ => $child->ID, in this case… also my want to wrap the foreach with if (count($children) > 0) {} to prevent possible errors where there are no children. ie: $children = get_children( $mainid ); if (count($children) > 0) { … Read more

Front-end registration form with password field

If you were to use a plugin that uses shortcode you can call it in your template by using this in your template: <?php echo do_shortcode (‘[your-shortcode]’); ?> You can also do something similar to this form / code below for a front end login: <form method=”post” action=”<?php bloginfo(‘url’) ?>/wp-login.php” class=”wp-user-form”> <div class=”username”> <label for=”user_login”><?php … Read more

Front end posting

You can not use wp_redirect() if the headers have already been sent so snippet you provided should not be used within your template files, instead you should wrap it within a function and place it into your functions.php file and hook onto template_redirect action. Example: add_action(‘template_redirect’, ‘front_end_post’, 99); function front_end_post() { if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] … Read more

How to add correct Last update in Postings (the_modified_time)

You could compare post_date to post_modified and only echo your content if they do not match. // inside a Loop if ($post->post_date != $post->post_modified) { ?> <span style=”font-size:85%”>Last update <u><time datetime=”<?php the_modified_time(‘d-m-y’); ?>”> <?php the_modified_time(‘l j F, Y’); ?></time></u></span><?php } If you want “significant” updates, though, you will need to determine what counts as significant … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)