WordPress.org

Ready to get started?Download WordPress

Forums

just a simple PHP question (1 post)

  1. arthurdent2003
    Member
    Posted 2 years ago #

    How would be the better way of writing this code:

    the aim: the custom post type name should link to blog/custom_post_type

    this snippet here works - but how could I do it better?

    <?php
    	echo ('<a href="');
    
    	$url = get_home_url(); echo $url;
    
    	echo ('/'); 
    
    	$post_type = get_post_type( $post->ID ); echo $post_type; 
    
    	echo ('">'); 
    
    	echo ('<span style="text-transform: uppercase">');
    
    	$post_type = get_post_type( $post->ID ); echo $post_type;
    	echo('</span></a>');
    ?>

    thanks!

    AD

Topic Closed

This topic has been closed to new replies.

About this Topic