Comments form custom fields order

Demo – Setup Here’s a demo how we could control the display of comment fields and their order: Let’s create a custom class: $mycf = new MyCommentFields; Then we define our extra fields: $myfields = []; $myfields[‘myaddress’] = sprintf( ‘<p class=”comment-form-myaddress”> <label for=”myaddress”>%s <span class=”required”>*</span></label> <input id=”myaddress” name=”myaddress” type=”text” size=”30″ tabindex=”5″ /> </p>’, esc_html__( ‘Address’, … Read more

Order by Custom Field date not recognized

I can’t get a meta_key parameter to pass through a GET string at all. Many other parameters that I tested do pass through, though I did not do an exhaustive test, but meta_key does not. If you want to verify that just add the following to the top of your header.php and inspect the query. … Read more

Problem in custom meta boxes

Okay got the issue, here is the complete code that is saving data. The issues are explained at the bottom: /** * Adds a box to the main column on the Post and Page edit screens. */ function nss_mood_add_meta_box() { //$id, $title, $callback, $post_type, $context,$priority, $callback_args add_meta_box(‘nss_mood_id’,’Set your mood’,’nss_mood_cb’,’post’); } add_action(‘add_meta_boxes’,’nss_mood_add_meta_box’); // Dispalying form and … Read more

How do I assign this filter to a variable? (Appending php & markup to the_content)

Congratulations on (nearly) solving your problem already 🙂 There are 2 comments below the post that attempt to say how to do it the right way They are proposing to do it this way: function weedub_affiliate_filter($content) { $string_to_add = ”; if (is_single()) { $string_to_add = $string_to_add . ‘the string you wanted to add’; } $content … Read more

Calling Specific Pages with wp query Part II

Two issues here The default page post type is page, not pages Your meta_query is wrong, it should be an array of an array, not just an array Your arguments should be $args = array( ‘post_type’ => ‘page’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 50, ‘meta_query’ => array( array( ‘key’ => ‘field_5505a81b83234’, // field key generated … Read more

WordPress custom upload field error

You can use the great wordpress media manager. I’ve prepared a plugin to attach PDF files to noraml posts. You can download it here. The php: <?php /* Plugin Name: PDF Metabox Plugin URI: https://github.com/CybMeta/cyb-pdf-metabox Description: Displays a metabox to attach a PDF file to current post. Author: Juan Padial Version: 1.0.2 Author URI: http://cybmeta.com … Read more

wp_editor in add_meta_boxes does not show gallery

Make sure tinymce option has a valid value. Remove it or set it to true if you don’t pass any parameters to tinymce $editor_config = array( ‘teeny’=>true, ‘textarea_rows’=>10, ‘editor_class’=>’csec_text’, ‘textarea_name’=>’csec_body’, ‘wpautop’=>false, ‘tinymce’=>$tinymce_options //THIS OPTION SHOULD BE VALID ); Edit: Made a small research. Add wpview in plugins argument of tinymce options. $tinymce_options = array( ‘plugins’ … Read more

Best way to allow manageable social media URLS?

The best way is on the user profile page using the contact methods extension: add_filter( ‘user_contactmethods’, ‘more_contactmethods’ ); function more_contactmethods( $contactmethods ) { $contactmethods[‘twitter’] = ‘Twitter username’; $contactmethods[‘facebook’] = ‘Facebook URL’; return $contactmethods; } This adds fields to the user profile page for those social networks. You can have as many as you like, then … Read more

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