Install Laravel 4 in Windows

Tuts Type : Laravel 4  Install in windows
Level : Beginnear / Intermediate
Time : 25-30 Minutes 

 

Programming world are pretty fast now. Developers try to invent the new language system and methodology to serve there purpose as well as others. In this continuation  Taylor Otwell, a web programmer developed a new web based PHP framework is called Laravel. Some developer are trying to update this framework regularly. As a result, laravel stand on version 4.

If I consider all of my readers know the installation process of laravel 3, then laravel 4 is little bit different. Some people think that, it is complected due to its based on composer, but really it is easy to install. So, lets start…

1. Composer is mandatory to use in Laravel 4. You have to download composer and install it. Just download composer and install. This will install composer globally on your system, based on where your php.exe is located. Normally its in xampp/htdocs/php folder.
2. After that, install GIT. I personally suggest to install Full installer for official Git for Windows that is 1.8.1.2 version. After that, you have to choose path variable of your computer. The process are following-

01

a. START > MY COMPUTER > PROPERTIES

01__b

b. ADVANCED > ENVIRONMENT VARIABLES
c. double click on PATH from SYSTEM VARIABLES
d. now copy the path address of git installer (normally in windows it’s by default address is C:\Program Files\Git\bin. If you have changed your directory, then change according your directory). You must put “;” before putting your path address.

Continue reading

Advertisements

show all post form specific post_type in wordpress

Hello all,
Now I am going to show how to get the post from a specific post type. Just follow the code –

$args = array( 'post_type' => 'product', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
	the_title();
	echo '<div>';
	the_content();
	echo '</div>';
endwhile;

Just put this information in your desire page and it will be post last 10 post. Be remember to change the ‘product’ name. It must be the name of your post type.

Thanks for reading…

The WordPress Theme Search Template and Page Template

The Search Template and The Page Template are vital to any complete WordPress Theme. And they’re both really easy to code. For both these two Templates we’ll start with our template-template again.

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
<?php get_header(); ?>
    
        <div id="container"
            <div id="content">
            
                <div id="nav-above" class="navigation">
                </div><!-- #nav-above -->
                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                </div><!-- #post-<?php the_ID(); ?> -->          
                
                <div id="nav-below" class="navigation">
                </div><!-- #nav-below -->                  
            
            </div><!-- #content -->    
        </div><!-- #container -->
        
<?php get_sidebar(); ?>  
<?php get_footer(); ?>

But, of course, each one is going to take it’s own different path.

The Search Template

In search.php we’re going to reintroduce the loop back into our Template. This time with an IF statement—in case we don’t have any posts to loop through.

Here’s how it’ll work: IF we have posts, or, in other words, if there are posts that match the terms we’re searching for, THEN loop through them, sorta just like in index.php, but IF we don’t have posts to loop through, or, if there aren’t any posts that match our search terms, give our searchers another chance at this searching business.

In code, it would look like this:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php get_header(); ?>
    
        <div id="container"
            <div id="content">
            
<?php if ( have_posts() ) : ?>               
<?php while ( have_posts() ) : the_post() ?>
<!-- this is our loop -->
<?php endwhile; ?>
<?php else : ?>
<!-- here's where we'll put a search form if there're no posts -->
<?php endif; ?>          
            </div><!-- #content -->    
        </div><!-- #container -->
        
<?php get_sidebar(); ?>  
<?php get_footer(); ?>

Pretty straightforward, right? Almost.

I like to keep all my index-ey Templates the same: Post Title, Meta, Content (or excerpt), Utility links. But when WordPress searches for posts it also searches through Pages, which don’t need the post meta or utility links displayed. So, in our loop, we’re going to check and see if we’re dealing with a post or a page. Continue reading