I have been working with the php file (on a wordpress custom theme which won't be updated at any point) to make the home page.php pull in three posts. It was initially set up by another developer who had it working with another dbase so I am trying to make the posts I have inserted fit with the existing php. Could anyone help me out by suggesting what I can put to change the code to fit specific post ID rather than recnet posts? Or if you know of any tutorials which would help me as I cannot find anything.
Code
<?php
$args = array(
'numberposts' => 1,
'orderby' => 'date',
'order' => 'desc',
'post_type' => 'post',
'post_status' => 'publish',
// 'post_parent' => '90',
'suppress_filters' => true
);
$recent_posts = wp_get_recent_posts($args, $output = ARRAY_A);
foreach ($recent_posts as $recent) {
?>
<div class="col-md-4" style="margin-bottom: 20px;">
<a href="<?php
echo get_permalink($recent['ID']);
?><?php
echo get_permalink($post->ID);
?>" title="<?php
echo esc_attr($recent['post_title']);
?>" >
<div class="feature-item">
<?php
if (has_post_thumbnail($recent["ID"])) {
?>
<?php
$image = wp_get_attachment_image_src(get_post_thumbnail_id($recent["ID"]), 'single-post-thumbnail');
?>
<img src='<?php
echo $image[0];
?>' style='width: 100%; border-radius: 6px'>
<?php
}
?>
<div class='feature-title'><?php
echo $recent['post_title'];
?></div>
<div class='feature-content'><?php
echo substr($recent['post_content'], 0, 80);
?></div>
</div>
</a>
</div>
<?php
}
?>
I have tried simply changing the args to have:
$args = array(
'numberposts' => 1,
'post_type' => 'page',
'post_status' => 'publish',
'ID' => '268');
but realise the $recent_posts commands throw out the ID function.
Any help massively appreciated.