Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi joseysanti,

    Each individual menu item has it’s own page, and you can link directly to them from posts or in your navigation menus.

    If you want to display a menu with a link to each navigation menu item, though, you’ll need to be able to work with the PHP templates.

    I’ve written a short tutorial on customizing the restaurant menu templates. But it does require getting your hands dirty with a little code.

    Removing the sidebar will depend on your theme. Many themes come with a “full page” or “full width” page template which doesn’t include a sidebar. If your theme has this, you can create a Page for your menu, select that page template, and then use the menu shortcode (eg – –[fdm-menu id=123]) to display your menu on the page.

    If you don’t have a page template like that in your theme, you’ll need to create a separate template file for your menus. This requires some coding know-how.

    If you’re comfortable creating template files, you’ll want to copy the single.php file in your template, rename it single-fdm-menu.php, and remove the sidebar code from that template.

    Thread Starter joseysanti

    (@joseysanti)

    ok, I dont mind gettin my hands dirty with the code…..but I just want, if is possible, be able to click on an image of the menu ittem and link me to your page….

    Ok, so once you’ve read the tutorial above, and you know how to create custom templates, you’ll want to edit the /content/image.php template. Currently it looks like this:

    <img class="fdm-item-image" src="<?php echo esc_attr( $this->image ); ?>" title="<?php echo esc_attr( $this->title ); ?>" alt="<?php echo esc_attr( $this->title ); ?>">

    You can wrap that in a link to the menu item like this:

    <a href="<?php echo esc_url( get_permalink( $this->id ) ); ?>">
      <img class="fdm-item-image" src="<?php echo esc_attr( $this->image ); ?>" title="<?php echo esc_attr( $this->title ); ?>" alt="<?php echo esc_attr( $this->title ); ?>">
    </a>
    Thread Starter joseysanti

    (@joseysanti)

    I dont see images.php…..????????

    Hi joseysanti,

    You’ll need to follow the tutorial on customizing the templates. It describes where you can find all of the templates and where to copy them over to your theme in order to override them.

    Hi! I was also wondering how to make it so that clicking on an item photo directs me to another website page. Is the only way to do this by overriding the existing code? I’m new to coding, so I am not super confident in my ability to do this.

    Hi seafoodassistantweb,

    Yes, the only way to do this is to customize the template code. If you’re not comfortable making code changes, I’d recommend you check out codeable.io. They match small customization projects like this with qualified freelancers.

    Thanks for your help!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘links to menu item’ is closed to new replies.