Forum Replies Created

Viewing 9 Topics - 1 through 9 (of 9 total)
Author Posts
May 24, 2013 at 7:18 pm in reply to: Show info author in single.php 4158
creatius creatius

Now I’m testing with twentytwelve.

May 24, 2013 at 6:53 pm in reply to: Show info author in single.php 4156
creatius creatius

Solved, I just did it with the following code:

$user_info = get_userdata($post->post_author);

$phone = $user_info->phone;
 echo ☎

Thanks, I just need to fix the map in the author.php

May 24, 2013 at 6:48 pm in reply to: Show info author in single.php 4155
creatius creatius

Sorry, I did not want to confuse the request. I just tested the code but does not work.

May 24, 2013 at 12:29 pm in reply to: No Show Google Maps in author page 4136
creatius creatius

Sorry, made ​​two queries in the same post, I confused. The problem that I have, which added wpuf-functions.php code and does not work with the following shortcode

<? php echo wpuf_shortcode_map_user ('map', $ user_id);?>

thanks

May 24, 2013 at 10:45 am in reply to: No Show Google Maps in author page 4115
creatius creatius

To display the map in author.php put the following code:

May 24, 2013 at 10:11 am in reply to: No Show Google Maps in author page 4109
creatius creatius

The map you want to display on the author page. I tried the above code does not work. Displays the map but does not show the address. (author.php)

In single.php page need to show custom fields author, but shows no result with the previous variable.

May 24, 2013 at 9:46 am in reply to: No Show Google Maps in author page 4103
creatius creatius

I think not, because it does not show any results. As I can see user data within a post?

By the way the map in the profile does not work, you can review the above code please?

Thank you very much.

May 23, 2013 at 11:25 pm in reply to: No Show Google Maps in author page 4098
creatius creatius

Hello again, I also noticed that the author’s custom fields shown in the entries. Used this code:

single.php

<?php
$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
?>

<?php echo get_user_meta( $curauth->ID, 'telefono', true ); ?>

Thanks

May 23, 2013 at 9:46 pm in reply to: No Show Google Maps in author page 4094
creatius creatius

Thanks!

I just try, added the following code at line 663, but still showing the map in the ocean.
Is that correct?

shortcode

<?php echo wpuf_shortcode_map_user( 'mapa', $user_id ); ?>

function wpuf_shortcode_map( $location, $post_id = null, $args = array() ) {
     
    // compatibility
    if ( $post_id ) {
        wpuf_shortcode_map_post( $location, $post_id, $args );
        return;
    }
 
    $default = array('width' => 450, 'height' => 250, 'zoom' => 12);
    $args = wp_parse_args( $args, $default );
 
    list( $def_lat, $def_long ) = explode( ',', $location );
    $def_lat = $def_lat ? $def_lat : 0;
    $def_long = $def_long ? $def_long : 0;
    ?>
 
    <div class="google-map" style="margin: 10px 0; height: <?php echo $args['height']; ?>px; width: <?php echo $args['width']; ?>px;" id="wpuf-map-<?php echo $meta_key; ?>"></div>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
 
    <script type="text/javascript">
        jQuery(function($){
            var curpoint = new google.maps.LatLng(<?php echo $def_lat; ?>, <?php echo $def_long; ?>);
 
            var gmap = new google.maps.Map( $('#wpuf-map-<?php echo $meta_key; ?>')[0], {
                center: curpoint,
                zoom: <?php echo $args['zoom']; ?>,
                mapTypeId: window.google.maps.MapTypeId.ROADMAP
            });
 
            var marker = new window.google.maps.Marker({
                position: curpoint,
                map: gmap,
                draggable: true
            });
        });
    </script>
    <?php
}
 
/**
 * Map shortcode for users
 *
 * @param string $meta_key
 * @param int $user_id
 * @param array $args
 */
function wpuf_shortcode_map_user( $meta_key, $user_id = null, $args = array() ) {
    $location = get_user_meta( $user_id, $meta_key, true );
    wpuf_shortcode_map( $location, null, $args );
}
 
/**
 * Map shortcode post posts
 *
 * @global object $post
 * @param string $meta_key
 * @param int $post_id
 * @param array $args
 */
function wpuf_shortcode_map_post( $meta_key, $post_id = null, $args = array() ) {
    global $post;
     
    if ( !$post_id ) {
        $post_id = $post->ID;
    }
     
    $location = get_post_meta( $post_id, $meta_key, true );
    wpuf_shortcode_map( $location, null, $args );
}
Viewing 9 Topics - 1 through 9 (of 9 total)