View Single Post
  #4  
Old June 16th, 2013, 08:34 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

This could help. Place the following into your theme's functions.php file:
PHP Code:
<?php
function map_mid_to_cpt$merchant_id ) {
    
$map = array(
        
12345 => get_permalink),
        
23456 => get_permalink),
        
34567 => get_permalink),
        
45678 => get_permalink),
        
56789 => get_permalink),
    );
    return 
$map[$merchant_id]; 
}
?>
12345, 23456, 34567, etc represent the Datafeedr merchant ID.
1, 2, 3, 4, 5 represent the ID of the post or page about that merchant. See http://codex.wordpress.org/Function_.../get_permalink for more info.

Then in your Views you would do something like this:
HTML Code:
<a href="<?php echo map_mid_to_cpt( $product->merchant_id ); ?>">More info</a>
Eric