Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $alltags= array();
- $args = array(
- 'order' => 'ASC',
- 'orderby' => 'menu_order',
- 'hierarchical' => 1,
- 'exclude' => '',
- 'include' => '',
- 'meta_key' => '',
- 'meta_value' => '',
- 'authors' => '',
- 'child_of' => 0,
- 'parent' => $id,
- 'exclude_tree' => '',
- 'number' => '',
- 'offset' => 0,
- 'post_type' => 'page',
- 'post_status' => 'publish',
- 'cat' => 399,
- 'posts_per_page' =>100,
- );
- $query = new WP_Query( $args );
- $pages = $query->posts;
- foreach($pages as $page) {
- // echo "<pre>";
- //print_r($page);
- //echo "</pre>";
- //$meta = get_post_meta($page->ID, '', true);
- $tags = wp_get_post_tags($page->ID);
- if ($tags) {
- foreach ($tags as $tag) {
- // $tag->name = str_replace('&', "", $tag->name);
- array_push($alltags, $tag->name);
- }
- }
- }
- $uniquetag = array_unique($alltags);
- asort($uniquetag);
- array_unshift($uniquetag , 'All');
- echo "<pre>";
- print_r($uniquetag);
- echo "</pre>";
- ?>
- <div class="row">
- <div class="toolbar mb2 mt2">
- <?php
- if($uniquetag){
- foreach ($uniquetag as $key => $value) { if($value =='Addhomeportfolio') { }
- else {
- ?>
- <button class="btn fil-cat" data-rel="<?php $string = str_replace(' ', '', $value); echo $string = str_replace('&', "", $string); ?>"><?php echo $value; ?></button>
- <?php
- } }
- }
- ?>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement