Display Child Page title and Image In WordPress

<?php
$child_pages = $wpdb->get_results(“SELECT *    FROM $wpdb->posts WHERE post_parent = “.$post->ID.”    AND post_type = ‘page’ ORDER BY menu_order”, ‘OBJECT’);  ?>
<?php if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild );
$i+=count($pageChild); ?>

<a href=”<?php echo  get_permalink($pageChild->ID); ?>” rel=”bookmark” title=”<?php echo $pageChild->post_title; ?>”> <?php echo get_the_post_thumbnail($pageChild->ID, ‘full’); ?></a><br/>
<h3><a href=”<?php echo  get_permalink($pageChild->ID); ?>” rel=”bookmark” title=”<?php echo $pageChild->post_title; ?>”><?php echo $pageChild->post_title; ?></a></h3>

<?php endforeach; endif; ?>

0

WordPress Function

WordPress Function

  1. Jquery Include

    <?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?>

2. Thumbnail Image

<?php the_post_thumbnail();?>

<?php  the_post_thumbnail(‘thumbnail’);  ?>

<?php  the_post_thumbnail(‘medium’);   ?>

<?php the_post_thumbnail(‘large’);      ?>

<?php the_post_thumbnail(‘full’);?>

    <?php the_post_thumbnail( array(100,100) );?>
3. Get Template Url 
    <?php get_template_directory(); ?> 
    <?php get_template_directory_uri(); ?>
0

How to Prevent Your WordPress Website from Being Hacked

How to Prevent Your WordPress Website from Being Hacked

  1. Keep your WordPress website updated with the latest version of WordPress.  Wordpress is regularly upgraded with new functionality and wity security measures that help stop hackers.
  2. Use complex usernames and passwords as described above.
  3. Install security plugins such as Better WP Security.  It covers most of the wordpress vulnerabilities mentioned earlier in this blog post.
  4. Install WP Security Scan.  It will scan your code and look for anything that is out of place like malware.  It will also make you aware of any vulnerabilities that it finds.
  5. Change the prefix of your WordPress database tables.
  6. Make the changes described earlier to your .htaccess file to prevent hackers from accessing important files that could cause vulnerabilities if accessed.  Also make changes to your .htaccess file to prevent SQL injection and URL hacks.
  7. Move your admin panel login to a URL that is not so easily identified and not common.  Limit the number of unsuccessful login attempts.
0

Woocommerce Category, Image , Description Display

<?php
$all_categories = get_categories( ‘taxonomy=product_cat&hide_empty=0&hierarchical=1’ );
foreach ($all_categories as $cat) {
//print_r($cat);
if($cat->category_parent == 13) {
$category_id = $cat->term_id;
$thumbnail_id     = get_woocommerce_term_meta( $cat->term_id, ‘thumbnail_id’, true );
$image = wp_get_attachment_url( $thumbnail_id );
/*echo ‘<a href=”‘. get_term_link($cat->slug, ‘product_cat’) .'”><div>’. “Read more” .'</div></a>’;*/

?>

<li style=”width: 183px;”>
<div>
<h3><?php  echo $cat->name; ?></h3>
<div><img src=”<?php echo $image; ?>” alt=”<?php $cat->name; ?>” width=”120″ height=”120″ /></div>
<p><?php echo $cat->description;?></p>

<?php echo ‘<a title=”Edit Product” href=”‘.get_term_link($cat->slug, ‘product_cat’).'”>Read More</a>’; ?>
</div>
</li>

<?php
}
}?>

0

How to Install WordPress

1 Checking to ensure that you and your web host have the minimum requirements to run WordPress.
2 Download the latest release of WordPress.
3 Unzip the downloaded file to a folder on your hard drive.
4 Be prepared with a secure password for your Secret Key
5 Print this page out so you have it handy during the installation.

Using Cpanel

  1. Log in to your cPanel.
  2. Click MySQL Database Wizard icon under the Databases section.
  3. In Step 1. Create a Database enter the database name and click Next Step.
  4. In Step 2. Create Database Users enter the database user name and the password. Make sure to use a strong password. Click Create User.
  5. In Step 3. Add User to Database click the All Privileges checkbox and click Next Step.
  6. In Step 4. Complete the task note the database name and user. Write down the values of hostname, username, databasename, and the password you chose. (Note that hostname will usually be localhost.)
0