WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] calling the home page (3 posts)

  1. cristiMaghiar
    Member
    Posted 4 years ago #

    hi,
    i'm trying to run an audio player only for the home page and i'm using this code

    <?php
    	wp_reset_query();
    	if (is_page('home')) {
    		echo '<p><a href="/audiofiles/EmpireStateofMind.mp3"
    class="wpaudio">empireStateOfMind</a></p>';
    	} else {
    		echo '<p class="no-sound"></p>';
    	}
    	?>

    when i change the the line » if (is_page ('home')) to » if (is_page ('despre noi')) it works fine for that page, but when the argument is 'home' the code generates the empty paragraph. Is there another way to call the first page?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try if( is_front_page() ).

  3. cristiMaghiar
    Member
    Posted 4 years ago #

    thanks, that's it

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.