How to get adjacent_post custom_field value

I think I solved the problem in this way: I get the custom field data using get_post_meta: <?php $prev_post_type = get_post_meta($prev_post->ID, ‘_product_type’, true);?> and then I use it to customize the link: <a href=”https://wordpress.stackexchange.com/questions/252475/<?php echo get_permalink( $prev_post->ID ); ?>”><?php echo $prev_post_title .” “. $prev_post_type ?></a>

custom post permalink

On the WordPress dashboard navigate to tools > permalinks. Then you will see a ” Custom Structure” field under common settings. You can use this to create custom permalinks. Here’s a link to the WordPress codex about permalinks. I think what you need to fill in the custom field is this /service/%category%/%postname%.

Convert Custom Post Data to Javascript Array for Autocomplete

$args = array( ‘post_type’ => ‘promo’ ); $loop = new WP_Query( $args ); $promos = array(); while ( $loop->have_posts() ) : $loop->the_post(); foreach((get_the_category()) as $category); $promos[] = $category->cat_name. ‘ – ‘ .get_the_title(); endwhile; echo ‘<script> jQuery(document).ready(function($) { var promoList=”.json_encode($promos) .”; $( “#auto-promo” ).autocomplete({ source: promoList }); }); </script>’;