picandocodigo / List-Category-Posts

WordPress plugin which allows you to list posts from a category into a post/page using the [catlist] shortcode.
http://wordpress.org/extend/plugins/list-category-posts/
GNU General Public License v2.0
241 stars 112 forks source link

Template #482

Closed mustafaefdal1 closed 2 years ago

mustafaefdal1 commented 2 years ago

Hello there,

Do someone have any basic template example for list category post? I tried to write a template but i cant do it. someone can help?

ım trying to write template like these https://prnt.sc/yVmyyAN7K1xc

picandocodigo commented 2 years ago

Hi @mustafaefdal1, You can look at the code for the default template which is used by default by the plugin to display the posts. The source code documented and hopefully can help you build your own template. I'd like to add some example templates in the future, but in the meantime, that's the best starting point.

Cheers

mustafaefdal1 commented 2 years ago

Hello,

Thanks for your reply. Isn't this documentation? Don't I need to add the codes here to the theme I wrote externally? I couldn't write a theme because I thought like that.

klemens-st commented 2 years ago

Have you read the basic introduction to templates in the documentation?

The documentation will guide you where to find important files and what to do with your template code.

mustafaefdal1 commented 2 years ago

Hello there

Of course i have. but i still have problems. so i opened this issue. i just need basic example.

<!DOCTYPE html>
<html>
<head>
    <title></title>
 <style type="text/css">
  .header{
    color: #303030;
    font-family: sans-serif;
      text-align: center;

  }

  img{
  -webkit-filter: brightness(100%);
  filter: brightness(100%);
  transition: all .3s ease-in-out;
}

img:hover{
  -webkit-filter: brightness(80%);
  filter: brightness(80%);
}
td:hover{
  border: 3px solid #004FA1;
  border-radius: 15px;
  padding: 8px;
}

 </style>
</head>
<body>
    <h1 class="header" >Geçiş kontrol </h1>
    <h1 class="header"  >__________</h1>
    <?php 

    $satir=10;
    $sutun=5;
    echo "<table border=1  bordercolor=white align=center >";
      for ($i=1; $i<=$satir ; $i++) 
      { 
          echo "<tr>";
          for ($k=1; $k <=$sutun ; $k++) 
          {
           echo "<td><a href=https://tr.olcsancad.com/hid-crescendo-c2300-series/ target=_blank ><img src=crescendo.jpg width=230px height=210px>deneme</a>";
          echo "<center><font face=sans-serif color=#086ad8 ><strong> HID Crescendo C2300 Serisi</strong></font></center> ";
           echo "</td>";
          }
          echo "</tr>";
      }
    echo "</table>";
    ?>
</body>
</html>

this is the code i wrote for example. i cant resolve how to use catlist codes in default.php. maybe you can help in this way?

klemens-st commented 2 years ago

So you are not trying to use an LCP template, you are writing a theme template.

This means you are essentially trying to use a shortcode in PHP, you need the do_shortcode function.

mustafaefdal1 commented 2 years ago

Hey,

yes i know you're tired of me =) but can you give a little example in my code?

klemens-st commented 2 years ago

In PHP you just use echo do_shortcode('[catlist]');. The shortcode will render normally.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.