Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter annabinna

    (@annabinna)

    Ok. Solved! I’ve done a mistake in the text-domain name in some functions.

    Now it works like a charm!

    Thanks for this piece of code guys!

    Thread Starter annabinna

    (@annabinna)

    Hey! I’ve forgoten to close this thread!

    Finally I’ve found the problem an the solution at once. The problem was in the javascript function. I’ve only had to move the js code to a separated file and to enqueue it in functions.php after the main leaflet js file. It was all!

    Thread Starter annabinna

    (@annabinna)

    I’ve done some changes in the way we feed the geodata array and move the echo wp_json_encode( $geodata ); inside the script tag, as a javascript variable.

    Now, the page is ok but still not displaying the map…

    <?php
    /**
     * @package Illes de futur
     */
    ?>
    
    <!-- http://asmaloney.com/2014/01/code/creating-an-interactive-map-with-leaflet-and-openstreetmap/ -->
    
    <section id="scene-map">
    
    	<div id="map" style="heigth: 440px; border: 1px solid #aaa;"></div>
    
    	<?php
    
    	  	$terms = get_the_term_list( $post->ID, 'production' );
    	  	$id = get_the_ID();
    
    	  	$args = array(
    	  		'post_type' => 'scene',
    	  		'tax_query' => array(
    	  			'taxonomy' => 'production',
    	  			'field' => 'slug',
    	  			'terms' => $terms,
    	  			),
    	  		'exclude' => $id
    	  		);
    
    		$geodata = array();
    
    		$geolocated_scenes = new WP_Query($args);
    
    		if( $geolocated_scenes->have_posts() ) :
    
    			while( $geolocated_scenes->have_posts() ) : $geolocated_scenes->the_post();
    
    				$geodata[] = array(
    					'name' => get_the_title(),
    					'url' => get_post_permalink(),
    					'lat' => get_post_meta( $post->ID, 'latitude', true ),
    					'lng' => get_post_meta( $post->ID, 'longitude', true ),
    				);
    
    			endwhile;
    
    			wp_reset_postdata();
    
    		else : ?>
    
    			<p><?php __('This scene has not geolocation data', 'illles_de_futur'); ?></p>
    
    		<? endif;
    
    	?>
    
    	<script type="text/javascript">
    
    		var geodata = <?php echo wp_json_encode( $geodata ); ?>;
    
    		var map = L.map( 'map', {
    			center: [20.0, 5.0],
    			minZoom: 2,
    			zoom: 2
    		});
    
    		L.tileLayer( 'http://{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
    			attribution:'&copy; <a href="http://osm.org/copyright" title="OpenStreetMap" target="_blank">OpenStreetMap</a> contributors | Tiles Courtesy of <a href="http://www.mapquest.com/" title="MapQuest" target="_blank">MapQuest</a><img src="http://developer.mapquest.com/osm/mq_logo.png" width="16" height="16" />',
    			subdomains: ['otile1' , 'otile2' , 'otile3' , 'otile4']
    		}).addTo( map );
    
    		for ( var i=0; i < geodata.length; ++i )
    		{
    			L.geodata( [geodata[i].lat, geodata[i].lng] )
    				.bindPopup( '<a href="' + geodata[i].url + '">' geodata[i].name + '</a>' )
    				.addTo( map );
    		}
    
    	</script>
    
    </section>
    Thread Starter annabinna

    (@annabinna)

    I’ve changed the css lines to these, but still doesn’t work!

    .slideshow-window,
    .jetpack-slideshow {
        background: transparent !important;
        border: transparent !important;
        max-height: 550px;
    }
    
    .slideshow-slide {
        width: 100%;
        height: auto !important;
        overflow: hidden;
        }
    
    .slideshow-slide img {width: 100%;}
    
    .slideshow-line-height-hack {}
    .slideshow-slide-caption {}
    
    .slideshow-controls {}
    Thread Starter annabinna

    (@annabinna)

    Just fixed!

    I’ve forgotten to change the path where uploaded files ara saved in the media options when I moved the site from a subfolder to the root last week.

    After changing the path, image uploader works again!

    Thanks!

    Hi jerryskate!

    Do you display only the last post at the top or do you want to reverse the order of all the post column?

    In the former, you might use multiple loops as wordpress reference for the_loop() function indicates. In the latter, you need to use a query parameter: query_posts( $query_string . '&order=DESC' ); in your actual loop, see an example in this page.

    Good luck!

    Forum: Fixing WordPress
    In reply to: Images

    May are you using get_attachment_image_*function in your theme?

    I think your problem is related with the size of the retrieved image (probably ‘thumbnail’). Look here to learn how it works.

    Thread Starter annabinna

    (@annabinna)

    Ja fa la seva feina només d’instal·lar el connector, però a més ajuda a aprendre com millorar la seguretat de la teva instal·lació de wordpress amb ajusts humans i tècnics.

    I’m in the same trouble, but I want to modify the archive.php instead of single.php.

    I used this code at the top of the file:

    <?php
    global $wp_query;
    
    if is_category('enunaparaula-cat') {
    	get_header('enunaparaula');
    } else {
        get_header();
    } ?>

    I have the header-enunaparaula.php too and nothing happens! Somebody knows why not?

Viewing 9 replies - 1 through 9 (of 9 total)