Tuesday, 2 December 2014

Add new font to css file / Add New font to web page

@font-face {
 font-family: 'Lato-Reg';
 src: url('http://fonturl/Lato-Reg.ttf')  format('truetype');
 font-weight: normal;
 font-style: normal;
}

@font-face {
 font-family: 'Lato-RegIta';
 src: url('http:///fonturl/Lato-RegIta.ttf')  format('truetype');
 font-weight: normal;
 font-style: normal;
}

Tuesday, 28 October 2014

Manage products / students with records for page limited, Pagenation script with manage products, PHP pagination, PHP paging, PHP pagination.



Connection.php
Sample connection file
<?php
 $servername="localhost"; // host name here
 $databaseusername=" "; // database username here
 $databasepassword=""; // database name here
mysql_connect($servername,$databaseusername,$databasepassword);  $databasename=mysql_select_db(“database name here”); // database name here
?>
Delete product based on category, after product delete redirect to particular products category, Product delete / record delete, delete record after redirect to particular category
<?php include('includes/session.php'); ?>
<?php
include("includes/connection.php");
 $id=$_GET['id'];
 $deletedatarec="delete from students where id='$id'";
 $productdata="select * from students where id='$id'";
  $productdatab=mysql_query($productdata);
 $rec=mysql_fetch_assoc($productdatab); 
 $delrecord=mysql_query($deletedatarec);
// 5th Class
if($rec['productname'] == "5th Class")
{
  echo "<script language='javascript'>window.location='5th Class-manage.php';</script>";
}
// 6th Class
if($rec['productname'] == "6th Class"){
  echo "<script language='javascript'>window.location='6th Class-manage.php';</script>";
}
// 7th Class
if($rec['productname'] == "7th Class")
{
  echo "<script language='javascript'>window.location='7th Class-manage.php';</script>";
}




// 8th Class
if($rec['productname'] == "8th Class")
{
  echo "<script language='javascript'>window.location='8th Class-manage.php';</script>";
}  
  else { echo "error"; }  ?>






Manage products / students with records for page limited, Pagenation script with manage products, PHP pagination, PHP paging, PHP pagination.

<!-- save this script in example page: manageproducts.php   for page numbers area (4 areas below use same page name) -->

 <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr><td colspan="5" align="center" valign="middle" class="product-title">This is Product heading</td> </tr>
<tr class="sub-head-tr">
 <td width="16%" align="center" valign="middle" ><strong>Part Number</strong></td>
  <td width="30%" align="center" valign="middle"><strong>Product Category</strong></td>
<td width="35%" align="center" valign="middle"><strong>Title</strong></td>
 <td width="11%" align="center" valign="middle"><strong>Edit</strong></td>
<td width="8%" align="center" valign="middle"><strong>Delete</strong></td>
</tr>
<?php
 include('includes/connection.php'); // this is database connection file
$pages_query = mysql_query("SELECT COUNT('id') FROM students where productname='productcategoryname' order by id desc");//get the number of contents
$pages = ceil(mysql_result($pages_query, 0) / $per_page);// get the number of pages
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
 $start = ($page - 1) * $per_page; //get the starting content id of each page
$query = mysql_query("SELECT * FROM students where productname='productcategoryname' order by id desc LIMIT $start, $per_page");      
                while($formvalue = mysql_fetch_assoc($query))            
{
echo "<tr class='general-tr'>";
 echo "<td align='left'>".$formvalue['value1']."&nbsp;</td>";   
 echo "<td align='left'>".$formvalue['productname']."&nbsp;</td>";
echo "<td align='left'>".$formvalue['title']."&nbsp;</td>";
echo "<td align='center'><a href='product-edit.php?id=".$formvalue['id']."' target='_parent'>Edit</a></td>";echo "<td align='center' class='lasttd'><a href='product-delete.php?id=".$formvalue['id']."' target='_parent'  onclick='return confirm(\"Are You Sure?\");'>Delete</a></td></tr>";
}

                $pagenum=mysql_num_rows($query);
                if($pagenum==0)
 {
echo "<tr class='data'><td   align='center' colspan='3'><div class='nodata'>No Products</div></td></tr>";
}

                /////////////////////////////////////////////////////////
               
                echo "<tr><td colspan='5'><div class='pagenumbers'>";
                $prev = $page - 1;            $next = $page + 1;          
                if(!($page<=1)){
                                echo "<a href='manageproducts.php?page=$prev'>Prev</a> ";
                }
                if($pages>=1 && $page<=$pages){         
                                for($x=1;$x<=$pages;$x++){
                                                echo ($x == $page) ? '<strong><a href="manageproducts.php?page='.$x.'">'.$x.'</a></strong> ' : '<a href="manageproducts.php?page='.$x.'">'.$x.'</a> '; }         
                }             
                if(!($page>=$pages)){   echo "<a href='manageproducts.php?page=$next'>Next</a>";                }             
echo "</div></td></tr>";
?>
        </table>



Saturday, 27 September 2014

Wordpress site magration / move wordpress files to local to external server

When your moving wordpress  to another server or wordpress local server to external server  migration process
Follow this steps
  1. Upload to files live
  2. Create database & note login details, import database to live database
  3. Change database connection in .wp-config.php (Username, Password , Hostname etc).
  4. Change 2 paths in database table wp-options table.




  • Login in sitename.com/wp-admin

Then go to permalinks once select other & save, then select post type in permalinks then save

Then test once I think now your site is working perfect.

Wordpress site magration / move wordpress files to local to external server

Friday, 12 September 2014

Wordpress Basics / Important things in wordpress website development

Basic things in WordPress CMS Development


Common things in CMS
  • Hide admin logo
  • Remove footer copy right message & add our copyright message
  • Change id to permalinks
  • Replace logo and fevicon
  • Remove caption below logo
  • Change username password (Update client details)
  • Remove screen options
  • Remove comments option
  • Update static page
  • Update Navigation menu
  • Enquiry form & form data delivery email id.
  • Test form delivery email and user email also(received or not data)
  •  
hide footer:
  • wp-admin/css/comman.css 
  • #wpfooter {display:none !important}

    Hide small wp-icon top icon :


    wp-content/themes/themename/style.css (this style sheet open from wp-admin panel)
    #wpadminbar #wp-admin-bar-wp-logo>.ab-item{ display:none !important;} /* for small logo hide */
    #wp-admin-bar-site-name{display:none !important;} /* for sitename dropdown menu */
    #wp-admin-bar-updates{display:none !important;} /* for updates link */
    #wp-admin-bar-comments{display:none !important;} /* for comments link */
    #wp-admin-bar-new-content {display:none !important;} /* for new page link */
     

Important Plug-ins
  • Easy Image Gallery
  • Simple Page Sidebars
  • Ultimate short codes
  • Cyclone Slider
  • Google Analytics (https://wordpress.org/plugins/googleanalytics/     use based on your wp version)


Add class for home page content or background
·         Body .home #content {background: red !important;} or leave !important depend on your style sheet.

Page based background or any special class based on page id
·         .page-id-16 #content {background-color: yellow !important;}

Hide admin logo
·         .login h1 a { display: none !important;} in wp-admin/css/login-min.css

Where I want remove “Category Archives” in wordpress category before text(front of category heading in engrave-lite theme)

wp-content/themes/engrave-lite/admin/main/options/00.general-settings.php
Change or remove on above page in your theme page (approximate 150 line in above source page).


Testing & Delivery
  • Check with login once, Username as email id & password(it is better to recover password)
  • Footer copy right message
  • Admin Logo
  • Site title
  • List of menus as client requirement(order also).
  • Test form delivery email and user email also(received or not data)
  • Test logo and fevicon.