Mihail Semjonov
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to write to variable get_template_file() ?Found the mistake in code..
where ‘ajax’ is specifyed in my case should be content/ajax, becouse my file is located in folder..Forum: Plugins
In reply to: Single category selectHere’s the update to prevent users from not selecting eny of custom taxanomie
function unit_admin_head() { $taxanomies = array('unit_status','unit_types'); if($taxanomies){ echo '<style>'; foreach($taxanomies as $tax){ echo 'ul#'.$tax.'-tabs { display: none !important; } '; } echo '</style>'; echo "<script type='text/javascript'>\n"; echo "jQuery(function($){\n"; foreach($taxanomies as $tax){ echo ' var $'.$tax.' = $("#'.$tax.'checklist").find(\'input[type="radio"]\'); if($'.$tax.'.length > 0){ var checked_'.$tax.' = 0; $'.$tax.'.each(function(){ if($(this).attr("checked") == "checked"){ checked_'.$tax.'++; } }); if(checked_'.$tax.' == 0){ $'.$tax.'.first().attr("checked","checked"); } }'; } echo "\n});"; echo "\n</script>"; } } add_action('admin_head', 'unit_admin_head');
Not a realy good js code, but works..
Forum: Plugins
In reply to: [Date and Time Picker Field] Not showing saved data in edit screenok. thanks!
Forum: Plugins
In reply to: [Date and Time Picker Field] Not showing saved data in edit screenI’v changed it in plugin. In file that stands for working with ACF 4.
Yes, changing that diractly in plugin might not work after updating, but since i’m requiring it, it woun’t be update..
I just hope that plugin developers will fix these and there would be no need to manualy do such thing.
As a solution u can dublicate these plugin.. change it name and make 2 fields with date/time and wen will be update and value will show in normal plugin then just turn off your copy plugin and make all fields from the updated plugin.Forum: Fixing WordPress
In reply to: Next and prev post link to posts where custom field is setthank for links, i have an idea how to make that, but i don’t know how to make my current post an offset from it.. could you help with that ?
What i mean is: i parse my current post id to function and then making new wp_query and as an offset sending the current id parametr.. is there some kind of solution ?
Forum: Plugins
In reply to: [Date and Time Picker Field] Not showing saved data in edit screenBecouse no one was answering made changes to file and replaced 1 function in acf4 version.
function create_field( $field ) { $field = array_merge( $this->defaults, $field ); extract( $field, EXTR_SKIP ); //Declare each item in $field as its own variable i.e.: $name, $value, $label, $time_format, $date_format and $show_week_number global $post; $metas = get_post_meta($post->ID); $meta_key = ''; if($metas){ foreach($metas as $k => $meta){ if($meta[0] == $key){ $meta_key = $k; } } } $meta_key = ltrim($meta_key,'_'); $value = get_field($meta_key); if ( $show_date != 'true' ) { echo '<input type="text" value="' . $value . '" name="' . $name . '" class="ps_timepicker" data-picker="' . $picker . '" data-time_format="' . $time_format . '" title="' . $label . '" />'; } else { echo '<input type="text" value="' . $value . '" name="' . $name . '" class="ps_timepicker" data-picker="' . $picker . '" data-date_format="' . $date_format . '" data-time_format="' . $time_format . '" data-show_week_number="' . $show_week_number . '" title="' . $label . '" />'; } }
The code I’v added is:
global $post; $metas = get_post_meta($post->ID); $meta_key = ''; if($metas){ foreach($metas as $k => $meta){ if($meta[0] == $key){ $meta_key = $k; } } } $meta_key = ltrim($meta_key,'_'); $value = get_field($meta_key);
That if someone has same problem it’s a quick solution..
but lets hope that plugin developers will fix that isue and make it work right!Forum: Fixing WordPress
In reply to: How to hide wp-pagenavi settingsmade it not from remove_submenu_page.. but works.
if someone in future will need that you can do next:/** * Убираем субменю с wp_pagenavi */ add_action( 'admin_menu', 'edit_admin_menus' ); function edit_admin_menus() { global $menu; global $submenu; if($submenu && $submenu['options-general.php']){ foreach($submenu['options-general.php'] as $key => $options){ if($options && $options[2] == 'pagenavi'){ unset($submenu['options-general.php'][$key]); } } } }
Forum: Plugins
In reply to: [M7 Go Top] plug in not workingHey, thanks for you’r tip. I’ll chack that and fix. Will be avalible in future versions. Stey up to. )
For now it’s not avalible for phones or tablets.
Plugin is steel in development so when will be v 1.0 relese it will work perfectly in all sistems with all the features.
Forum: Fixing WordPress
In reply to: How to create custom post format and add it on custom post type ?in includes/post.php i have found wordpress funtion that contains array of post formats
function get_post_format_strings() { $strings = array( 'standard' => _x( 'Standard', 'Post format' ), // Special case. any value that evals to false will be considered standard 'aside' => _x( 'Aside', 'Post format' ), 'chat' => _x( 'Chat', 'Post format' ), 'gallery' => _x( 'Gallery', 'Post format' ), 'link' => _x( 'Link', 'Post format' ), 'image' => _x( 'Image', 'Post format' ), 'quote' => _x( 'Quote', 'Post format' ), 'status' => _x( 'Status', 'Post format' ), 'video' => _x( 'Video', 'Post format' ), 'audio' => _x( 'Audio', 'Post format' ), ); return $strings; }
I’m not realy fomiliar with php (i mean i’m not to good at it).
Can i redeclear that function, so that wordpress do not fall for that function but so that it returns my own (that will be decleared in functions.php in theme) so I mean something like these:if( function_exists( 'get_post_format_strings' ) ){ //delete the function that is decleared in includes/post.php //declear new 'get_post_format_strings' function : function get_post_format_strings() { $strings = array( 'standard' => _x( 'Standard', 'Post format' ), // Special case. any value that evals to false will be considered standard 'aside' => _x( 'Aside', 'Post format' ), 'chat' => _x( 'Chat', 'Post format' ), 'gallery' => _x( 'Gallery', 'Post format' ), 'link' => _x( 'Link', 'Post format' ), 'image' => _x( 'Image', 'Post format' ), 'quote' => _x( 'Quote', 'Post format' ), 'status' => _x( 'Status', 'Post format' ), 'video' => _x( 'Video', 'Post format' ), 'audio' => _x( 'Audio', 'Post format' ), 'product' => _x( 'Product', 'Post format' ), ); return $strings; } }
Forum: Fixing WordPress
In reply to: how to wp_query – meta_query value string contain in key string ?Hey!!
Yes you got that! I’t works for me) thanks!!cunjo:
I guess you misunderstood me!)
The main page and blog page, only these pages begun to load slower after doing the|| is_front_page() || is_home()
adding to the inline buttons.The single and page loaded normaly, in apr. 1 sec.
Give it a try, add
|| is_front_page() || is_home()
and check how long it will load the blog page. If your time will be faster then 5 sec. then I apologize and it’s my servers fall.found the solution: in plugins file where the inline buttons displays there’s a if (is_single() || is_page() )
you can add || is_front_page() /or, and/ || is_home() and it will show in front page or blog.
But the problem is that after doing this plugin gets loaded over 20 sec. (my page was loading 24-37 seconds). That’s why i decided not to use these plugin and use anothere.Forum: Fixing WordPress
In reply to: Adding new plugin – where to insert readme.txt ?Thanks.
I use BonPress from WPZOOM. All othere plugins were deactivated and still not showing. Could you tell what posible thing might be in theme so that your plugin stoped working in blog page ??
Forum: Fixing WordPress
In reply to: Make posts from 500 id to 3000 ??up! pls. Help!!!