plugin not working for adding post to page
plugin not working for adding post to page
plugin not working for adding post to page
Maybe try the following: function set_robotsmeta_default( $post_object ) { if (!isset($post_object->robotsmeta) || $post_object->robotsmeta == “”) { $post_object->robotsmeta = “noindex,nofollow”; } return $post_object; } add_action( ‘the_post’, ‘set_robotsmeta_default’ ); EDIT: Since the above didn’t work, the code below may work, by editing the global $post object before the plugin add_meta_boxes is called. I just don’t know if … Read more
Short: You can’t. Php functions can’t be run “straight” from a button because they run server side. You need either to set a $_POST or $_GET (so you can run the function on the page load) or use ajax/javascript. You can find multiple answers to this question on the site already. For example this. edit: … Read more
How know the “admin” blog from wordpress multisite?
Maybe you should copy plugin from theme folder to plugin directory and activate it. EDIT: I’m sorry. I misunderstand you. I want to have that field optional It’s needed to change theme php code. The task will be easier if you publish this code. I guess there is registered save_post hook in the theme code. … Read more
How to run my plugin only when the whole page is sent?
Thanks @toscho — The problem plugin in particular is wp-pagenavi. The backend strings are being translated, however; the frontend remains in default en_US locale. I found this: https://wordpress.org/support/topic/translation-91 To be more specific, the text field values on plugin options page do not get translated so my assumption is that translations are malformed somewhere in the … Read more
To show a page at the custom post type ‘home’ you need to create a regular page with that slug. You can then add the page to the menu. I think I saw this in a different answer somewhere, but can’t find it right now.
I’ve found out that having mulitple settings_fields wouldn’t work. So in register_setting I use the same group name and now all the fields are updated correctly. I got it from this http://www.mendoweb.be/blog/wordpress-settings-api-multiple-sections-on-same-page/
Just remove the ID then. $images = get_the_author_meta( ‘images’, $user->ID ); $images = explode(‘,’,$images); $images is an Array isn’t it? Then I hope this one can help you. https://stackoverflow.com/questions/2448964/php-how-to-remove-specific-element-from-an-array