How to Custome Wp Page Reading Query getting?

Below code for sameple custome page reading query.
Post Thumbnail URL Finding :

<?php //$mini_tennis_rewards_thumb = get_the_post_thumbnail($mini_tennis_rewards_data->ID, array(63,63));
$mini_tennis_rewards_thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( $mini_tennis_rewards_data->ID ), “thumbnail” );
?>

<a href=”<?php echo get_permalink($mini_tennis_rewards_data->ID); ?>”><img src=”<?php echo $mini_tennis_rewards_thumb_src[0]; ?>” /><span><?php echo $mini_tennis_rewards_data->post_title; ?></span></a>

<?php
$page_name = array(134,4778,4780,4782,4784,4786);

$privateCoaching_data = get_page($page_name[0]);
$proVideos_data = get_page($page_name[1]);
$calendar_data = get_page($page_name[2]);
$tipsOfTheWeek_data = get_page($page_name[3]);
$juniorPathway_data = get_page($page_name[4]);
$adultPathway_data = get_page($page_name[5]);
?>
<h1><a href=”<?php echo get_permalink($privateCoaching_data->ID); ?>”>Private Lessons</a></h1>

<img src=”<?php bloginfo( ‘stylesheet_directory’ ); ?>/images/privateLessons.jpg” />
<a href=”<?php echo get_permalink($privateCoaching_data->ID); ?>”><img src=”<?php bloginfo( ‘stylesheet_directory’ ); ?>/images/read-more.jpg” border=”0″ /></a>
<?php
//$privateCoaching_data_content = apply_filters(‘the_excerpt’, $privateCoaching_data->post_excerpt); // Get Content and retain WordPress filters such as paragraph tags. Origin from: http://wordpress.org/support/topic/get_pagepost-and-no-paragraphs-problem
//echo $privateCoaching_data_content;
echo $privateCoaching_data->post_excerpt;
?>

<!– Below line showes the post image –>

<?php echo get_the_post_thumbnail($mini_tennis_rewards_data->ID, ‘full’); ?>

This is line shows only for Image URL :

$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "size" );

this is useful for custom post reader or page reader purpose.

How to Creating dynamic table in PHP?

<?php
echo ‘
<table border=”1″ width=”50%”>
<tbody>
<tr>’;
$content = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
$counter = 0;
foreach($content as $data) {
if($counter != 0 && $counter%3 == 0) {
echo “</tr>
<tr>”;
}
echo ”
<td>”;
echo $data;
echo “</td>
“;
$counter++;
}
echo ‘</tr>
</tbody>
</table>
‘;
?>
<table border=”0″ cellspacing=”0″ cellpadding=”0″>
<tbody>
<tr>
<?php
$args = array(
‘numberposts’ => -1,
‘post_parent’ => $post->ID,
‘post_type’ => ‘page’,
‘post_status’ => ‘publish’,
‘orderby’ => ‘menu_order,title’,
‘order’ => ‘ASC’
);
$my_pagelist = &get_children($args);

if ($my_pagelist) {
//                  echo count($my_pagelist);
//echo get_the_post_thumbnail($my_child->ID, ‘thumbnail’, array(‘class’ => ‘ourservices-thumb’));
//echo get_the_post_thumbnail($my_child->ID, ‘medium’, array(‘class’ => ‘ourservices-thumb’));
//echo get_the_post_thumbnail($my_child->ID, ‘full’, array(‘class’ => ‘ourservices-thumb’));
//echo sizeof($my_child).” – “.count($my_child);
//                $count = count($my_child);
$counter = 0;
foreach($my_pagelist as $my_child) {
$my_child_slug = $my_slug . ‘/’. $my_child->post_name.’/’;
if($counter != 0 && $counter%3 == 0) {
echo “</tr>
<tr>”;
}
echo ‘
<td>’;
echo get_the_post_thumbnail($my_child->ID, array(200,120), array(‘class’ => ‘ourservices-thumb’)).’
<h3><a href=”‘.$my_child_slug.'”>”‘.$my_child->post_title.'”</a></h3>
‘;
echo ‘</td>
‘;
$counter++;
}

}
?></tr>
</tbody>
</table>
enjoy just for fun: This is easy for coding guys.
other guys is very diffcult. I am searching more things in google. then i found the solution for this. Thanks for all google users.

That’s all. :)

© 2020 Spirituality