Get the frontend/output of meta_value
-
Hey guys!
My problem is I want to order posts with the meta_key “rating”, but the problem is the meta_value is a direct link to an IMDB movie (url) fetching the imdb rating and transform it into the imdb rating on output Is there a way around this, so it can sort by the transformed output and not the meta_value field that contains an URL?
I use the plugin “imdb-connector” to help fetch and transform the rating, is there a way to use imdb-connector PHP functions to order the output from the meta_value field?
My code:
<?php if ($_POST['select'] == 'prijsn') { $order = "&order=DESC&meta_key=rating&orderby=meta_value"; ?>
Is there a way to implement the meta_value “rating” of meta-key to be the output on the site? with use of this code in some kind:
<?php $rating="Rating"; $imdbrating = get_post_meta($post->ID, $rating, true); $movie = imdb_connector_get_movie($imdbrating); echo $movie["imdbrating"]; ?>
- The topic ‘Get the frontend/output of meta_value’ is closed to new replies.