wiktoratgmail
Forum Replies Created
-
Forum: Hacks
In reply to: Change Default "Posts" Admin IconMore universal solution is to use inline translation –
__('PHRASE TO TRANSLATE')than icon will be substituted in any language:add_action( 'admin_menu', 'gowp_admin_menu' ); function gowp_admin_menu() { global $menu; foreach ( $menu as $key => $val ) { if ( __( 'Posts') == $val[0] ) { $menu[$key][6] = 'dashicons-welcome-add-page'; } } }Forum: Plugins
In reply to: [Geo Mashup] How to close category lineI don’t have enough time to fight with KML 😉
I have some kind of solution. I’ve used subplugin geo-mashup-custom/info-window.php. In info-window I’ve made condition – if post have no thumbnail it will not be showed. I think this can be done also with custom-field.
<div class="locationinfo post-location-info"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="storycontent"> <?php if ( function_exists( 'has_post_thumbnail') and has_post_thumbnail() ) : ?> <h3><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <?php the_post_thumbnail('map-thumb'); ?> <?php the_excerpt('custom_excerpt_more','custom_excerpt_length'); ?> <?php endif; ?> </div> <?php endwhile; ?>Forum: Fixing WordPress
In reply to: Plugin WP Types – display default value if emptyThis is working for me:
<?php $url=(types_render_field("url", array("raw"=>"true"))); if ($url== '') { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"> <?php } else { ?> <a href="<?php echo (types_render_field("url", array("raw"=>"true"))); ?>" target="_blank" rel="bookmark" title="<?php the_title(); ?>"> <?php } ?>I have solution but is ugly. Just change all “+” to “,” in plugin files. After update all changes will gone. It’s not good solution but works for me. BTW this plugin is great!
core.php line 147
$query[ $taxonomy ] = trim( implode( '+', $value ), '+' );to
$query[ $taxonomy ] = trim( implode( ',', $value ), ',' );line 246
$value = implode( '+', $value );
to
$value = implode( ',', $value );walkers.php line 34
$query[$this->taxonomy] = $query[$this->taxonomy] . "+" . $this->term->slug;
to
$query[$this->taxonomy] = $query[$this->taxonomy] . "," . $this->term->slug;
line 61
$this->selected_terms = explode( '+', qmt_get_query( $this->taxonomy ) );to
$this->selected_terms = explode( ',', qmt_get_query( $this->taxonomy ) );It’s not working :-/
I’ve made this change in advanced-ajax-page-loader/ajax-page-loader.js and plugin is no longer working.
I’m going to test another plugin: http://ww.wp.xz.cn/extend/plugins/weather-and-weather-forecast-widget/
WP Google Weather was more simple, and customizable for me.
Attention Everyone! Empty categories aren’t displayed!
I’ve add post to one category and it get displayed.
Thank You for fast response 🙂
How can I get different fields in relation from, and to?
p2p_register_connection_type( array( 'name' => 'family_relationship', 'from' => 'person', 'to' => 'person', 'reciprocal' => false, 'cardinality' => 'one-to-many', 'title' => array( 'from' => 'He is a descendant', 'to' => 'It has a descendant' ), 'fields' => array( 'family-relationships' => array( 'title_to' => 'Type of relationship to the ancestor', 'values_to' => array( 'son', 'grandson' ), 'title_from' => 'Type of relationship to the descendant', 'values_from' => array( 'father', 'grandfather' ), ) ) ) );