sorry this file type is not permitted for security reasons. wordpress


Q. sorry this file type is not permitted for security reasons in wordpress

 

Ans.  If you want to turn off filtered upload policy altogether, so that you can upload arbitrary types of files to WordPress, do the following.

Open wp-config.php of your WordPress site with any text editor, and add the following line somewhere in the file.

  define('ALLOW_UNFILTERED_UPLOADS', true);

1455888

how to display custom post type in wordpress


<?php  $args = array( ‘post_type’ => ‘product’,’cat’=>’9′,’order’ => ‘ASC’,’posts_per_page’ => 3);
$the_query = new WP_Query( $args );
?>

<?php if ( $the_query->have_posts() ) : ?>

<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

<?php the_post_thumbnail(); ?>

<?php the_title(); ?></h3><?php the_content(); ?>

<?php endwhile; ?>
<?php endif; ?>

How to display post by category in wordpress


<?php
$args = array( ‘post_type’ => ‘post’,’cat’=>’9′,’order’ => ‘ASC’,’posts_per_page’ => 3);
$the_query = new WP_Query( $args );
?>

<?php if ( $the_query->have_posts() ) : ?>

<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php the_post_thumbnail(); ?>
<?php the_title(); ?>
<?php the_content(); ?>

<?php endwhile; ?>
<?php endif; ?>

how to create responsive menu in wordpress


.global_nav ul {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-bottom: 1px solid #FFFFFF;
border-image: none;
border-left: 1px solid #FFFFFF;
border-radius: 16px;
border-top: 1px solid #FFFFFF;
height: 30px;
margin-top: 7px;
overflow: hidden;
padding-left: 1px;
padding-top: 5px;
position: absolute;
width: 100px;
}

.global_nav ul li {
display: block;
padding: 0 7px 15px 13px;
}
.global_nav li a {
color: #FFFFFF;
display: inline-block;
float: left;
font-family: Arial,Helvetica,sans-serif;
font-size: 14px;
font-weight: bold;
line-height: 20px;
padding: 3px 26px 5px 3px;
text-transform: uppercase;
}
.global_nav {
margin-left: 0 !important;
}

how to change admin logo in wordpress


add_action(“login_head”, “my_login_head”);
function my_login_head() {
echo ”
<style>
body.login #login h1 a {
background: url(‘”.get_bloginfo(‘template_url’).”/img/_logo.png’) no-repeat scroll center top transparent;
height: 204px;
width: 400px;
margin-left: -41px;

}
</style>
“;
}

function put_my_url(){
return (‘http://mysite.com&#8217;);
}
add_filter(‘login_headerurl’, ‘put_my_url’);

How to Create a WordPress Child Theme


1

2

3

 

Once you have created your folder, you need to add the one and only file that is required to create a valid child theme – style.css. As you have no doubt guessed, this file will work as an addendum of sorts to your parent theme’s style.css file.

You’ll need to place some vital information inside of this file, so open up your favorite text editor and paste the following into a blank file:

/*
Theme Name: My Child Theme
Theme URI: http: //mysite.com/
Description: This is a custom child theme I have created.
Author: My Name
Author URI: http: //mysite.com/
Template: parentthemeVersion: 0.
*/

Obviously a lot of the information above is generic, and you can change it to suit your needs. There is only one variable that you must alter in order for your child theme to be valid – “Template”. This variable is required in order to tell your child theme which parent theme it is related to, and must be changed to match the folder name of your active theme.

How to text lenght count in javascript HTML


<html>
<head>
<title>Untitled Document</title>

<script src=”//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js”>
</script>
<script>
$(document).ready(function(){
var limitnum = 30;

function limiting(obj, limit) {
var cnt = $(“#counter > span”);
var txt = $(obj).val();
var len = txt.length;

if(len > limit){
$(obj).val(txt.substr(0,limit));
$(cnt).html(len-1);
}
else {
$(cnt).html(len);
}

if(limit-len <= 20) {
$(cnt).addClass(“warning”);
}
}

$(‘textarea’).keyup(function(){
limiting($(this), limitnum);
});
});
</script>
</head>

<body>

<div id=”w”>
<h1>text Count Limit</h1>
<h3>Text limited is 30 characters</h3>

<p id=”counter”><span>0</span> characters</p>

<textarea name=”text” id=”text” tabindex=”1″></textarea>
</div>

</body>
</html>

Select data from database


the use code selected data from database . the file name is select.php
<html>
<head>
<meta>
<title>select</title>
</head>

<body>
<?php
include(“db.php”);
$id=$_REQUEST[‘id’];
echo $id;
$query=”select * from record where id=$id”;
$row=mysql_query($query);
while($run=mysql_fetch_array($row))
{
?>
<h1 align=”center”>Employee Record</h1>
<form method=”post”>
<table border=”1″ align=”center” bgcolor=”#006699″>
<tr>
<td>firstname</td>
<td> <?php echo $run[‘firstname’];?> </td>
</tr>
<tr>
<td>lastname</td>
<td> <?php echo $run[‘lastname’];?> </td>
</tr>
<tr>
<td>fathername</td>
<td> <?php echo $run[‘fathername’];?> </td>
</tr>
<tr>
<td>dob</td>
<td> <select name=”dob”/>
<option>day</option>
<?php
for($day=1;$day<=31;$day++)
{
echo “<option>” .$day. “</option>”;
}
?>
</select>
<select>
<option>month</option>
<?php
$month=array(‘jan’,’feb’,’mar’,’april’,’may’,’june’,’july’,’aug’,’sep’,’oct’,’nov’,’dec’);
foreach($month as $a)
{
echo “<option>” .$a.”</option>”;
}
?>
</select>
<select>
<option>year</option>
<?php
for($year=1985;$year<=2013;$year++)
{
echo “<option>” .$year . “</option>”;
}
?>
</select>
</td>
</tr>
<tr>
<td>contactno</td>
<td> <?php echo $run[‘contactno’];?> </td>
</tr>
<tr>
<td>address</td>
<td> <?php echo $run[‘address’];?> </td>
</tr>
<tr>
<td>agreementsign</td>
<td> <?php echo $run[‘agreementsign’];?> </td>
</tr>
<tr>
<td>email</td>
<td> <?php echo $run[’email’];?> </td>
</tr>
<tr>
<td>password</td>
<td> <?php echo $run[‘password’];?> </td>
</tr>
<tr>
<td>gender</td>
<td> <input type=”radio” name=”gender” value=”m” />male
<input type=”radio” name=”gender” value=”f” />female</td>
</tr>
<tr>
<td colspan=”2″ align=”center”> <input type=”submit” name=”submit” value=”submit” /></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>

Delete values from database


use the code for delete dat from database . the file name delete.php

<html>
<head>
<meta>
<title>delete</title>
<?php
include(“db.php”);
$id=$_GET[‘id’];
echo $id;
?>

<?php
if (isset($_GET[‘id’]))
{
$query=”delete from record where id=’$id'”;
if(mysql_query($query))
{
header(‘location:usingquery.php’);
}
else
{
echo mysql_error();
}
}
if(isset($_POST[‘no’]))
{
header(‘location:usingquery.php’);
}
?>
</body>
</html>