I am creating a site that uses an isotope to filter messages on a page.
I use the advanced custom fields ( http://www.advancedcustomfields.com/ ) and created a section where the user can set the field for "Project Difficulty".
I am trying to do everything possible to create a list of links that the user can click to sort (using the isotope). I successfully work using "tags", but I donβt want to mark each project with a level of complexity, I want the user to select it when creating a message in the ACF drop-down list.
To successfully retrieve and display the tag list as links, I used this code:
<?php
$tags = get_tags();
$html = '<div class="post_tags">';
foreach ( $tags as $tag ) {
$tag_link = get_tag_link( $tag->term_id );
$html .= "<a data-filter=.{$tag->name} title='{$tag->name} Tag' class='{$tag->slug}'>";
$html .= "{$tag->name}</a>";
}
$html .= '</div>';
echo $html;
?>
, ACF, :
<?php
$fields = get_fields();
$html = '<div class="post_tags">';
foreach ( $fields as $field ) {
$tag_link = get_fields( $field->task_difficulty );
$html .= "<a data-filter=.{$field->name} title='{$field->name} Tag' class='{$field->slug}'>";
$html .= "{$field->name}</a>";
}
$html .= '</div>';
echo $html;
?>
:
<a data-filter="." title=" Tag" class=""></a>
. , . , ?