• Here’s my site, so you can see what I’m talking about:

    http://perfectlyincomplete.ktravisj.com/

    I am working on those three buttons at the top, “Home”, “Archive”, and “Contact”.

    Home’s fine.

    I am trying to fix “Archive” and “Contact”.

    These are editable in my

    Appearance >> Editor >> header.php file

    Here is the code for editing one:

    Archive:

    <!-- Main Menu -->
    		<div id="menu">
    
    			<a class="home pngf" href="<?php bloginfo("url"); ?>">
    				<span class="atit">HOME</span>
    				<span class="ttxt">is where the hearts is</span>
    				<span class="shad"> </span>
    			</a>
    			<!-- Link For Archives page -->
    			<a class="arch pngf" href="<?php bloginfo("url"); ?>?page_id=81">
    				<span class="atit">ARCHIVE</span>
    				<span class="ttxt">accumulated evidence</span>
    				<span class="shad"> </span>
    			</a>
    
    			<a class="cont pngf" href="#">
    				<span class="atit">CONTACT</span>
    				<span class="ttxt">me, or forever hold your peace</span>
    				<span class="shad"> </span>
    			</a>
    
    		</div>

    All I want to do is be able to go into my

    Pages >> Add New

    in my dashboard, and create pages called

    “Archive”
    “Contact”

    And fill in whatever content I want, in them, and then have that original top menu’s two buttons “Archive” and “Contact” link to these, respectively.

    How can I do this? I have made an Archive, and it’s page URL’s permalink is:

    http://ktravisj.com/blog/perfectlyincomplete/page_id81

    But I cannot seem to figure out the best way to insert it in the

    </a>
    			<!-- Link For Archives page -->
    			<a class="arch pngf" href="<?php bloginfo("url"); ?>?page_id=81">
    				<span class="atit">ARCHIVE</span>
    				<span class="ttxt">accumulated evidence</span>
    				<span class="shad"> </span>
    			</a>

    area of that code, for the “Archive” button.

    I need some help with syntax–can anyone help me?

    Thanks.

    –etcbbu

Viewing 2 replies - 1 through 2 (of 2 total)
  • you could try:

    <?php
    $page = get_page_by_title('Archive'); //use exact spelling
    $page_link = get_permalink($page->ID);
    ?>
    <!-- Link For Archives page -->
       <a class="arch pngf" href="<?php echo $page_link; ?>">
       <span class="atit">ARCHIVE</span>
       <span class="ttxt">accumulated evidence</span>
       <span class="shad"> </span>
       </a>

    http://codex.wordpress.org/Function_Reference/get_page_by_title
    http://codex.wordpress.org/Function_Reference/get_permalink

    Thread Starter etcbbu

    (@etcbbu)

    Works wonderfully~ Thank you, my friend.

    Now can I ask another thing:

    How does everyone recommend filling that “Contact” page? Like, is there any sort of third-party plugin I can get that will let me put a basic form in there, to capture user’s “Name”, “E-mail Address”, “Question/Comment”, and then a captcha? How could I go about doing that?

    Thanks.

    –etcbbu

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Need help on some code:’ is closed to new replies.