Skip to content

Fixes get_post_tags() and get_page_tags(), adds article_tags()#5

Open
KermMartian wants to merge 2 commits into
ntdb:masterfrom
Geopipe:master
Open

Fixes get_post_tags() and get_page_tags(), adds article_tags()#5
KermMartian wants to merge 2 commits into
ntdb:masterfrom
Geopipe:master

Conversation

@KermMartian
Copy link
Copy Markdown

@KermMartian KermMartian commented Jan 24, 2019

  1. Added proper use of $prefix when fetch tags via get_post_tags() and get_page_tags() (fixed some trailing issues from 457f46d).
  2. Fixed incorrect usage of "data_type" instead of "type" when specifically selecting either posts or pages.
  3. Added new article_tags() function that can be used as follow:
        <div class="container-fluid">
        <?php foreach(article_tags() as $tag) { ?>
            <a class="label label-primary" href="<?= base_url('') . '?tag=' . $tag; ?>"><?= $tag ?></a>
        <?php } ?>
        </div>

1. Added proper use of $prefix when fetch tags via get_post_tags() and
   get_page_tags().
2. Fixed incorrect usage of "data_type" instead of "type" when
   specifically selecting either posts or pages
It can be used, for example, in themes/yourtheme/article.php and
posts.php in a new section at the end of the given article:

    <div class="container-fluid">
    <?php foreach(article_tags() as $tag) { ?>
        <a class="label label-primary" href="<?= base_url('') . '?tag=' . $tag; ?>"><?= $tag ?></a>
    <?php } ?>
    </div>
@KermMartian KermMartian changed the title Added proper use of table prefix when fetching tags; fixed query error Fixes get_post_tags() and get_page_tags(), adds article_tags() Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant