WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

just a simple PHP question (1 post)

  1. arthurdent2003
    Member
    Posted 4 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