Monday, 25 July 2016

Remove public folder from .htaccess file in laravel

Put this code in root folder in .htaccess file. public folder showing problem shortout.
RewriteEngine On

RewriteCond %{HTTP_HOST} ^{http://ask4admission.com/}.{public} [NC]
RewriteRule (.*) http://www.{http://ask4admission.com/}.{public}/$1 [R=301,L]

RewriteCond %{http://ask4admission.com/} !public/
RewriteRule (.*) /public/$1 [L]

Tuesday, 12 July 2016

wordpress Dynamic page code very useful to you


Post code

<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>

.........................................................................

category id select

<?php if ( have_posts() ) : ?>
<?php query_posts('cat_ID=22'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
................................................................................
<?php
$args = array(  'posts_per_page' => 10,'category' => 4);
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); ?>
                <h3 style="text-transform: uppercase;
    font-weight: 600;text-align:center;padding:10px"><?php the_title(); ?></h3>
                <p style="font-size:16px;padding:0px 30px"><?php the_content(); ?></p>
<?php endforeach; ?>

.................................................
<?php
require('wp-blog-header.php');
?>
<?php query_posts('showposts=10&cat=4'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php the_content(__('Read more'));?>
<?php endwhile;?>

.........................................................
<?php
$args = array(  'posts_per_page' => 10,'category' => 4);
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); ?>
             <?php the_title(); ?>
             

<?php the_excerpt(); ?>
<a href=”<?php the_permalink(); ?>”>Read more…</a>
<?php endforeach; ?>
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

 next and prv chose post select catergory

<ul>
<?php

global $post;

$args = array( 'posts_per_page' => 5, 'offset'=> 1, 'category' => 1 );

$myposts = get_posts( $args );

foreach( $myposts as $post ) : setup_postdata($post); ?>
                <li>
          <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        </li>
<?php endforeach; ?>

</ul>
.............................................................................................

ALl post calling code


<?php
$args = array( 'posts_per_page' => 3 );
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); ?>
                <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                <?php the_content(); ?>
<?php endforeach; ?>
.....................................................................................

Select catgory all post display page


<?php
$args = array(  'posts_per_page' => 5,'category' => 24);
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); ?>
                <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                <?php the_content(); ?>
<?php endforeach; ?>
..............................................................................................
<?php $the_query = new WP_Query( 'showposts=1' ); ?>

    <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>

    <li><?php the_content(__('(more…)')); ?></li>
    <?php endwhile;?>
........................................................................................

Calling image or any link


<?php bloginfo( 'template_url' ); ?>/
<?php bloginfo('template_directory'); ?>/

.........................................................................................

menu calling code


1.  <?php wp_nav_menu( array( 'menu' => 'my')); ?>             Note: my is name of menu

2.   <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

3.        <a href="<?php echo home_url(); ?>">Home</a>
           <?php wp_list_pages('title_li='); ?>

..............................................................................................

Sub menu calling code


 <?php
$parent = get_post($post->post_parent);
if($parent->post_parent) {
$children = wp_list_pages("title_li=&child_of=".$parent->post_parent."&echo=0&depth=1");
} elseif ($post->post_parent) {
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=1");
} else {
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&depth=1");
}
if ($children) { ?>
<?php echo $children; ?>

    <?php } ?>

............................................................................................

categories menu calling code


<li><a href="<?php echo home_url(); ?>">Home</a></li>
                <li><?php wp_list_categories('title_li=&'); ?></li>
......................................................................................

Side bar Code


<?php get_sidebar(); ?>

................................................................................

Search form code


<?php get_search_form(); ?>

............................................................................................

comments calling code


<?php comments_template(); ?>
.............................................................................................

Dynamic page create wordpress code


<?php

/*

Template Name: THE fruit display

*/
?>
<?php get_header(); ?>

In this place puting HTML css code

<?php get_footer(); ?>

........................................................................

Posting code index.php page



  <?php if ( have_posts() ) : ?>
 <?php twentyeleven_content_nav( 'nav-above' ); ?>
 <?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_title(); ?>
                 
<?php the_content('Read the rest of this entry &raquo;'); ?>
<?php endwhile; ?>

<?php twentyeleven_content_nav( 'nav-below' ); ?>

<?php else : ?>

<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->

<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->

<?php endif; ?>
......................................................................................................................................

page .php file calling post code



<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'page' ); ?>

<?php comments_template( '', true ); ?>

<?php endwhile; // end of the loop. ?>


.....................................................................................................................

dyanamic widgit code and calling code


create widgit code function.php file

  <?php       register_sidebar( array(
'name' => __( 'Showcase Sidebar', 'twentyeleven' ),
'id' => 'sidebar-2',
'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
                ) );
                ?>
...................................................

calliing widgit code


  <?php if ( is_active_sidebar( 'sidebar-6' ) ) : ?>
                <div id="four" class="widget-area" role="complementary">
                                <?php dynamic_sidebar( 'sidebar-6' ); ?>
                </div><!-- #third .widget-area -->
                <?php endif; ?>
................................................................................................................................


Call all page id wise


<a href="<?php echo get_page_link(40); ?>">Map</a>

Email send php code



<?php
        extract($_POST);
    $mail="email@yahoo.co.in";
    $subject="Contact Form Enquiry";
    $body="
     Name :- $name <br/>
        Email :- $email <br/>
        Phone No. :- $phoneno<br/>
        Message :- $message
    ";
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
   $headers .= "Reply-To: <info@email.in>"."\r\n";
   $headers .= 'Cc: <email@gmail.com>'."\r\n";
  $headers .= 'Bcc: <email@gmail.com>'."\r\n";
    $headers .= 'Bcc: <email@gmail.com>'."\r\n";
 
    $headers .= "X-Mailer: PHP/".phpversion();
    $mail_status=mail($mail,$subject,$body,$headers);
    if($mail_status){ ?>
        <script>
            window.location='../index.html';
        </script>
    <?php
    }
    else{ ?>
        <script>
            alert("Error in Contact Form.");
            window.location='../index.html';
        </script>
    <?php
    }
            ?>

Media Query for responsive layout

@media screen and (min-width: 320px) and (max-width: 480px) 
Add Css here
}

Sunday, 10 July 2016

How to Install nodejs, mongodb in your system ?

There are few simple step if  you follow after that you enjoy angularJS, nodeJS and mondo db in your system...........

step 1. install NPM in your system from nodejs.org or npmjs.com
step 2. goto CMD and type following cammands
step 3. node -v (check version of  node )
step 4. npm install -g (npm install globaly in computer)
step 5. npm install bower -g (bower install globaly in your system)
step 6. npm install -g yo ( install yo globaly)
step 7. npm install -g grunt-cli bower yo generator-karma generator-angular (paste this line )

step 8. install mongodb in your system.

now every thing in going well and your setup is finish .lets enjoy your coding...
if you have any problem then comment here thanx..

Friday, 8 July 2016

how to increase Maximum upload file size in wordpress in cpanel

this is very simple ..you follow this simple step :
STEP 1. create php.ini file in root directory (put php.ini file in public_html)
STEP 2.paste this code.
upload_max_filesize = 50M
post_max_size = 50M (50M you increase or reduce acording to your requirment)
 then
STEP 3. goto your .htaccess file and paste this code here...

suPHP_ConfigPath /home/lastcorn/public_html

Now every thing is Done enjoy..