• Resolved onrboz

    (@onrboz)


    Hi,

    Is it possible to wordpress get_permalink for a special template page?

    Simple, by slug: “www……com/map”

    <a href="<?php echo get_page_link('map'); ?>">
    Map
    </a>

    i need,

    <a href="<?php echo get_page_link('Newpage'); ?>">
    Free
    </a>

    to

    <?php
    /*
    Template Name: Newpage
    */
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter onrboz

    (@onrboz)

    I tried something,

    <?php sp_url_get('spesical_page.php') ?>

    function sp_url_get($sp_name){
    	global $wpdb;
    	$mynameID = $wpdb->get_results( "SELECT post_id FROM wp_postmeta WHERE meta_value = '$sp_name'" );
    	foreach ($mynameID as $key) {
    		echo $key->post_id;
    	}
    }

    Out function sp_url_get($sp_name): 12,143,225…..353

    is more than one number..But there is only one of them. Others have been deleted page

    Thread Starter onrboz

    (@onrboz)

    Not help at all. thank you anyway. Figured out

    if(get_page($key->post_id))echo get_option('home').'/?p='.$key->post_id;

    Googluck

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_permalink by template name?’ is closed to new replies.