Creating wordpress user registration form

You are sending the data from the form directly to TestForm.php file, which is a PHP script outside of WordPress logic. It is and independent script. You could set the form’s action attribute to a empty string, this way the form data is sent to same page that contains the form, which is part of … Read more

Get the total Author Favorited posts

<?php $args22 = array( ‘post_type’ => array (‘menus’, ‘recipes’ ), ‘author’ => get_queried_object_id(), ‘meta_query’ => array( ‘meta_key’ => ‘simplefavorites_count’, ‘value’ => ‘0’, ‘compare’ => ‘>=’, ), ); $my_query = new WP_Query( $args22 ); echo ‘Found posts: ‘ . $my_query->found_posts . ‘<br />’; // declare variable and set total votes to 0 $total_fav_count = 0; if … Read more

Right way to display the_author_meta fields?

I would actually load them into an array: $author_contact = array( ’email’ => get_the_author_meta( ’email’ ), ‘telephone’ => get_the_author_meta( ‘telephone’ ), ‘twitter’ => get_the_author_meta( ‘twitter’ ), ); Once you have that created, you can iterate through it using a foreach() loop: <ul class=”author-contact”> <?php foreach( $author_contact as $contact => $address ) { if( isset( $contact … Read more

Custom content using in_category

in_category() accepts an array of categories to check against. So if you can get a list of all child categories for the parent category you want to check you can use that to see if your post is in any of those. You can do this by using get_categories() and specifying the parent. This will … Read more

Soflyy WP All Import Custom File Download Issue

Instead of custom curl HTTP request I’ll recommend you to use the wp_remote_post() or wp_remote_get() which internally call the HTTP request and handle all possible errors. Also use download_url() to download the file and media_handle_sideload() to upload the downloaded file into uploads directory.

remove_action() not working in page template – Genesis

Page templates are called too late to effect actions. You can achieve what you need another way, by targeting this in your functions, with a test for the page template, like this: function twl_content_wrap_start() { if ( !is_page_template( “page_full-width.php” ) ) return ‘<div class=”container”>’; } BTW, as a rule of thumb, actions generally don’t echo, … Read more