Here is the code that is as far as I could get. Still unable to display the custom taxonomies in the side
<?php
global $post;
$postid = $post->ID;
$systemon = get_field(“played_on”, $postid);
$genres = get_field(“genres”, $postid);
$esrb = get_field(“esrb”, $postid);
$publishers = get_field(“publishers”, $postid);
$developer = get_field(“developer”, $postid);
$players = get_field(“players”, $postid);
$release_date = get_field(“release_date”, $postid);
$price = get_field(“price”, $postid);
$score = get_post_meta($postid, ‘editor_score’, true);
echo ‘<div class=”system”>’;
echo __(‘Payed On: ‘).’ ‘.$systemon[0];
echo ‘</div>’;
echo ‘<div class=”system”>’;
echo __(‘Systems: ‘,’taxonomies-filter-widget’).’ ‘.$term->name;
echo ‘</div>’;
echo ‘<div class=”genre”>’;
echo __(‘Genre: ‘,’taxonomies-filter-widget’).’ ‘.$genres;
echo ‘</div>’;
echo ‘<div class=”esrb”>’;
echo __(‘ESRB: ‘,’taxonomies-filter-widget’).’ ‘.$esrb;
echo ‘</div>’;
echo ‘<div class=”publishers”>’;
echo __(‘Publisher: ‘,’taxonomies-filter-widget’).’ ‘.$publishers;
echo ‘</div>’;
echo ‘<div class=”developers”>’;
echo __(‘Developer: ‘,’taxonomies-filter-widget’).’ ‘.$developer;
echo ‘</div>’;
echo ‘<div class=”players”>’;
echo __(‘Players: ‘,’taxonomies-filter-widget’).’ ‘.$players;
echo ‘</div>’;
echo ‘<div class=”editorscore”>’;
echo __(‘Editor Score: ‘,’taxonomies-filter-widget’).’ ‘.$score;
echo ‘</div>’;
?>
Okay, after some work I have managed to get it calling the needed aspects
now the question is:
How can I get it to display taxonomies rather then then just outputting the code the database uses and how can I stop it from listing any array field as just the word Array.
Here is my code so far:
<?php
global $post;
$postid = $post->ID;
$systemon = get_field(“played_on”, $postid);
$score = get_post_meta($postid, ‘editor_score’, true);
echo ‘<div class=”system”>’;
echo __(‘Payed On: ‘).’ ‘.$systemon;
echo ‘</div>’;
echo ‘<div class=”editorscore”>’;
echo __(‘Editor Score: ‘,’taxonomies-filter-widget’).’ ‘.$score;
echo ‘</div>’;
?>
I managed to get it to show with this code in a widget:
<?php
$custom_field = get_post_custom_values(‘editor_score’);
if(!empty($custom_field)){
echo ‘<div class=”result-extra”>’;
echo __(‘Editor Score: ‘).”.$custom_field[0];
echo ‘</div>’;
}
?>
Only issue is if there are two entries in the fields it displays info like this:
a:3:{i:0;i:15;i:1;i:172;i:2;i:105;}
you can see this on: http://www.cgmagazine.ca/wordpress/game_review/saints-row-iv.html
The issue is it is not easy to add the code inside the loop. Since it uses sections you place to load the loop etc it can not be added as easy as seen either other themes.
They suggested using hooks to get it to work although these did not seem to give the desired output either.
Is there a way to use it with a widget or something?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.