- sketch2uk March 13, 2013 at 10:20 am
Hello, is it possible to remove the link on the menu items so there are no individual pages for items?
Juanfra Aldasoro March 13, 2013 at 1:27 pmHello there,
Yes – It is possible. You need to edit some files: template-menu.php and template-menu-list.php
template-menu.php
Look for line #70 and remove the a tag:
echo ‘<li><div><span><a href=”‘ . get_permalink( $post->ID ) . ‘”>’ . get_the_title() . ‘</a></span>’ . “\n”;
Should look like this:
echo ‘<li><div><span>’ . get_the_title() . ‘</span>’ . “\n”;
and line #111 the same:
echo ‘<div><span><a href=”‘ . get_permalink( $post->ID ) . ‘”>’ . get_the_title() . ‘</a></span>’ . “\n”;
Should look like this:
echo ‘<div><span>’ . get_the_title() . ‘</span>’ . “\n”;
(If your menu have images you’ll need to remove links from there too)
template-menu-list.php
Line #77 looks like this:
echo ‘<li><div><span><a name=”menu-item-‘ . $post->ID . ‘” href=”‘ . get_permalink( $post->ID ) . ‘”>’ . get_the_title() . ‘</a></span>’ . “\n”;Should look like this:
echo ‘<li><div><span><a name=”menu-item-‘ . $post->ID . ‘” >’ . get_the_title() . ‘</a></span>’ . “\n”;And line #128, the same:
echo ‘<div><span><a name=”menu-item-‘ . $post->ID . ‘” href=”‘ . get_permalink( $post->ID ) . ‘”>’ . get_the_title() . ‘</a></span>’ . “\n”;
Should look like this:
echo ‘<div><span><a name=”menu-item-‘ . $post->ID . ‘” >’ . get_the_title() . ‘</a></span>’ . “\n”;Best,
Juan.
This topic is marked as resolved
Only the topic author can re-open this thread.