SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Feb 2013
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    some basic questions regarding menu,links,blogs in WP.

    hi

    have some beginner questions regarding menus/links.

    question 1

    my current code for the top nav:

    Code PHP:
    <?php wp_nav_menu(array('menu_id' => 'primary'))?>

    Thats all i got, now i want to add fontello icons next to every pagelink, how do I do this? When creating a static site this could look like this: <a href="#><i class="icon-home"></i>Home</a> ... but how can i do this in WP when all i see is the php above?

    (im a noob to WP)

    question 2

    So i got an image on my site, that i want to make a link of. But the static <a href="imgdir"><img></a> wont work. So the question is.. how do i link between pages?

    question 3

    I have made a template file named news.php with template name "blog", and I have added this code:

    Code PHP:
    				<?php while(have_posts()): the_post()?>
     
    					<h2><a href="<?php the_permalink()?>"><?php the_title() ?></a></h2>
     
    					<?php the_content();?>
     
    				<?php endwhile;?>

    The problem is that nothing is shown when i create a new page and use the blog template. The exact same code works fine if i put it on index.php.

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    This will show all the options you have available to you for the wp_nav_menu function:

    http://codex.wordpress.org/Function_...ce/wp_nav_menu

    I'm not sure what you're asking with your image question. Are you trying to insert an image into a post or page? Or your theme?

    I don't understand what you're trying to accomplish with your news.php file. Here's how file naming works in wordpress:

    http://codex.wordpress.org/Template_Hierarchy

    You should also have a look at this: http://codex.wordpress.org/Theme_Development
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •