我已经创建了自定义模板,在其中我从数据库运行查询。在页面中,我已从数据库运行循环
所以我通过url将id带到另一个页面,并且链接是这样创建的,所以我想更改此链接
https://www.taxnetwork.in/single-share-file/?file_id=1
到这个
https://www.taxnetwork.in/single-share-file/file_name/
代码在这里
<?php
$results = $wpdb->get_results($wpdb->prepare(\'SELECT * FROM share_files where status = 1 \'));
foreach ($results as $r)
{
$item_name = $r->title;
$item_description = $r->description;
$img_path = $r->img_name;
$download = $r->file_path;
$cat_id = $r->category;
$file_id = $r->id;
$date = $r->post_date ;
$cat_res = $wpdb->get_results($wpdb->prepare(\'SELECT * FROM wp_files_cat where file_id = \'.$cat_id .\'\'));
?>
<div class="row" style=" margin:20px 0 ;border-bottom:1px #d8d8d8 dashed">
<div class="col-md-2 hidden-xs">
<a href="<?php echo bloginfo(\'url\') ?>/single-share-file?file_id=<?php echo $file_id ?>"><img src="<?php echo $img_path ?> "></a>
</div>
提前感谢!!!!