• Hey how’s it going? I have a blog and a website they are both on separate servers. I want to show tags from the blog on the website. I have already have the script that retrieves the tags and shows them on the site but I want them to be links to the tag pages. I can hard code the link example = echo http://example.com/$tag . I simplified that the syntax is wrong but what if i change the location from local to online i have to go in and change code. Easier way to do this? Thanks in advance.

Viewing 1 replies (of 1 total)
  • Thread Starter papilindo

    (@papilindo)

    thought the code would be useful

    $query = "
    SELECT *
    FROM <code>wp_term_taxonomy</code>
    INNER JOIN wp_terms ON wp_term_taxonomy.term_id = wp_terms.term_id
    WHERE taxonomy = 'post_tag'
    
    ";
    
    $result = mysql_query($query);
    
    //$row = mysql_fetch_array($result);
    
    while( $row = mysql_fetch_array($result)) {
    	//echo $row['term_taxonomy_id'];
    /* 	echo $row['name']."<br />";
    	echo $row['slug']."<br />"; */
    echo "<a href='http://localhost/blog/?tag=$row[name]' >$row[name]</a>"."<br />";
    }
Viewing 1 replies (of 1 total)

The topic ‘Showing information on external site’ is closed to new replies.