Wordpress topics

|| if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
   }
 
   It prevent public user to directly access your .php files through URL.
   Usage:
   It can be placed at the top of any of your PHP files (theme & plugin)
   It can be placed at the top of your wp-config.php 

Advertisements

Fix: WordPress Memory Exhausted Error – Increase PHP Memory

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 30720 bytes)

You need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.

define( 'WP_MEMORY_LIMIT', '256M' );

Google Live Map

<?php

/*
Template Name: map
*/

get_header();

?>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCPj2rrgRVKPap-cVS9_Wpd4fkBkXGF7fI&callback=myMap"></script>

<style>
	.common_page_container {border-top: 1px dashed #dddddd;margin:14px auto;padding: 24px 0;}
	.outletadd {padding: 0 0 0 3%;width:36%;}
	.store-col {float: left;margin: 0;}
	.store-col li {background:#f6f6f6;border: 1px solid #ddd;list-style: none;margin: 0 0 6px;padding: 3px 6px;}
	.store-col a {text-decoration: none; font-size: 13px;}
	#map-add {font-size: 13px; font-family: arial;}
	.map-add.store-col {float: left;margin: 0px;width:100%;}
	#MapCanvas {margin: 0;  max-width: 100%;min-height:380px;min-width: 300px;padding: 0;}
</style>

<script type="text/javascript">
	function updateMap(selectControl){ 
	    switch(selectControl){
			case 'Shimanto': 
			  initialize(23.738143,90.376614, "1st Floor, Road no-2, Dhanmondi, Dhaka<br/>Phone:+8802-8618890");
			  addressChange("Shimanto Square: <br/> 1st Floor, Road no-2, Dhanmondi, Dhaka <br/>Mobile:+88-01730068075");
			  break; 
			  
			case 'Mohammadpur':
			  initialize(23.76508,90.358429, "Shop No. 223-224, Toyko Square, Japan Garden City <br/>Mobile:+88-01730068069");
			  addressChange("Mohammadpur: <br/>Shop No. 223-224, Toyko Square, Japan Garden City <br/>Mobile:+88-01730068069");
			  break;
		}
	}   


	function initialize(lat,Lng,titletxt) { 
	    var mapOptions = {
	      center: new google.maps.LatLng(lat,Lng),
	      zoom: 17
	    };

	    var map = new google.maps.Map(document.getElementById("MapCanvas"),mapOptions);
		
		var marker = new google.maps.Marker({
			position: new google.maps.LatLng(lat,Lng),
			map: map,
			icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png'
			//title: 'Rang'
		});

		var infowindow = new google.maps.InfoWindow({
		  content: titletxt,
		  zIndex: 990,
		});

		infowindow.open(map,marker);
	}

	function addressChange(add){
		document.getElementById('map-add').innerHTML = add;	
	}

	jQuery(document).ready( function($) {
		google.maps.event.addDomListener(window, 'load', initialize(24.1263456,90.3802059, "269-272 Tejgaon I/A Dhaka-1208, Bangladesh <br/>Tel: +88 02-8870616, 8870631<br/>"),check);	
	});
		
</script>



<div class="common_page_container">
	<div class="selectoutlet store-col">
		<ul>
			<li><a href="javascript:;" rel="Shimanto" onclick="updateMap(this.rel)">&nbsp; Shimanto Square</a></li>
			<li><a href="javascript:;" rel="Mohammadpur" onclick="updateMap(this.rel)">&nbsp; Mohammadpur</a></li>
			
		</ul>
		<!--<form>
			<select name="mapchange"  onchange="updateMap(this.options[this.selectedIndex].value)">
				<option value="Basundhara">&nbsp; Basundhara City</option>
				<option value="pink_city">&nbsp; Pink City</option>
				<option value="jamuna_future">&nbsp;Jamuna Future Park 1</option>
				<option value="jamuna_future2">&nbsp;Jamuna Future Park 2</option>
				
			</select>
		</form> -->
	</div>
	<div class="outletadd store-col">
		<div id="map-add">269-272 Tejgaon I/A Dhaka-1208, Bangladesh <br/>Tel: +88 02-8870616, 8870631<br/>E-mail: info@energypac-fashions.com</div>
	</div>
	<div class="map-add store-col">
		<div id="MapCanvas"></div>
	</div>
	<div class="clearer"></div>
</div>


<?php 
get_footer(); 

?>

Image uploading Problem

|| File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini file

|| solved: Go to the file directory public_html wp-admin then put the php.ini file, and include following code


upload_max_filesize = 64M;
post_max_size = 32M;
safe_mode = off;