This repository has been archived on 2024-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
kspace-wordpress-theme/page-links.php

61 lines
2.1 KiB
PHP
Raw Permalink Normal View History

2022-12-18 19:19:04 +01:00
<?php /* Template Name: page-links */ ?>
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<article class="article-content" id="post-<?php the_ID(); ?>">
<h1 class="page-title"><?php the_title(); ?></h1>
<div class="article-body mb-2">
<?php the_content(); ?>
</div>
</article>
<div class="card head-primary">
2022-12-18 19:19:04 +01:00
<h2 class="card-header">Liste de mes réseaux sociaux</h2>
<table>
<thead>
<tr>
<th class="text-info">Réseau social</th>
<th class="text-right text-info">Lien</th>
</tr>
</thead>
<tbody>
<?php
$listmenu = get_nav_menu_locations();
$menu = wp_get_nav_menu_items($listmenu['social']);
if ($menu != null) {
foreach ($menu as $menuElement) {
?>
<tr>
2023-11-18 12:17:07 +01:00
<th><svg class="icon" alt=""><use xlink:href="#icon-<?php echo $menuElement->title; ?>"></use></svg> <span class="text-maj"><?php echo $menuElement->title; ?></span></th>
2022-12-18 19:19:04 +01:00
<td class="text-right"><a class="pretty-link" href="<?php echo $menuElement->url; ?>"><?php echo $menuElement->url; ?></td>
</tr>
<?php
}
}
?>
<?php
$listmenu = get_nav_menu_locations();
$menu = wp_get_nav_menu_items($listmenu['social-plus']);
if ($menu != null) {
foreach ($menu as $menuElement) {
?>
<tr>
2023-11-18 12:17:07 +01:00
<th><svg class="icon" alt=""><use xlink:href="#icon-<?php echo $menuElement->title; ?>"></use></svg> <span class="text-maj"><?php echo $menuElement->title; ?></span></th>
2022-12-18 19:19:04 +01:00
<td class="text-right"><a class="pretty-link" href="<?php echo $menuElement->url; ?>"><?php echo $menuElement->url; ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
<?php endwhile; ?>
<?php endif; ?>
</main>
<?php get_sidebar(); ?>
<?php get_footer(); ?>