Support » Localhost Installs » Modifying nav-menu from localhost

  • Hi

    I have set a XAMPP server to modify my website in the localhost. The main page is displayed perfectly, but links are generally bad configured. I have been looking for the file from my wp-content which I should modify in order to set the new local href for menu correctly, but I didn’t find where they are codified. Could somebody tell me where I could modify the href of the navigation menu items?

    Thank you

Viewing 15 replies - 1 through 15 (of 25 total)
  • esmi

    (@esmi)

    Forum Moderator

    links are generally bad configured

    In what way? You really need to provide a lot more detail before we can possibly help.

    I would like to set new hrefs for the menu options that appear in my site, but do not find the code where it is define. Where could I find it?

    esmi

    (@esmi)

    Forum Moderator

    We need details!
    Is this a custom menu?
    What theme are you using?
    What is wrong with the current urls?

    Right now, when I click on a link in the main page which loads z.php, the error I get is:

    Fatal error: Call to undefined function get_header() in C:\x\xampp\htdocs\web\wp-content\themes\y\z.php on line 7

    z.php loads the header at the beginning of the code, with the following line:
    <?php get_header(); ?>

    I have a header.php file in \x\xampp\htdocs\web\wp-content\themes\y\, but I guess it is not found. What is the reason of this fact?

    Thank you

    I have been looking around the forum in order to find a solution. This fatal error is quite common and i found the same problem in the following post:
    http://wordpress.org/support/topic/call-to-undefined-function-get_header-7

    In my case, the main file loads perfectly, but this one loads a sidebar file, which contains the code:

    <a href="/product-guide"><img src="<?php bloginfo('template_directory'); ?>/images/sidebar-cat.jpg"></a>
    
    		<div class="txt">
    			<h4>Visit our product guide</h4>
    			<a href="wp-content/themes/i/guide.php">View guide</a>
    		</div>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    The image is not found and the link to guide.php displays the fatal error mentioned above. The file guide.php has the code:
    <?php get_header(); ?>
    And here is where it goes wrong.

    My mistake, which i deduce from the other forum topic, is that the href to View guide is not correct, but how can I fix it????

    All files (guide, index, header, sidebar, footer…) are located in the template folder.

    Hi there
    Try replace
    <a href="wp-content/themes/i/guide.php">View guide</a>
    with
    <a href="<?php bloginfo('template_directory'); ?>/i/guide.php">View guide</a>
    let me know if this helps, or I need more detailed description to help you.

    adminadminadmin

    (@adminadminadmin)

    i changed it, but it did not work. In this case, the fatal error is gone, but i got a Not located object. In the whole page, most of the links are not working, but as I said before, the menu items brought me to Not located object page also. Is it possible that the problem is in the absolute URL, or something like this?

    Vitaliy K

    (@vitaliy-k)

    can i see guide.php code? is this a template? it’s assigned for any page?
    if not you can define this page as template by adding to the top of guide.php this

    /*
     * Template Name: Guide Page
     */

    After this you will be able to create page from admin and assign this template to this page. And you will be able to use absolute URL to this page. make sense?

    adminadminadmin

    (@adminadminadmin)

    This is the beginning of the guide.php code:

    <?php
    /*
    Template Name: Guide
    */
    ?>
    
    <?php get_header(); ?>
    
    <div class="bg-page">

    The code following just displays a pdf embedded. And yes, it is assigned for the page “Product guide” in the menu items from wordpress, defined in the backend.

    Vitaliy K

    (@vitaliy-k)

    what you see if you click “view” page (page with template Guide) from admin section?

    adminadminadmin

    (@adminadminadmin)

    what do you mean from admin section?

    Vitaliy K

    (@vitaliy-k)

    Yes, while you inside page in admin section you have the link “View page” under title.

    also can you turn on wordpress debuger before, just in case it shows more detailed error.

    You can do this by opening wp-config.php file and change this line
    define('WP_DEBUG', false);
    to
    define('WP_DEBUG', true);

    and after this try to view page and post here your results

    adminadminadmin

    (@adminadminadmin)

    I do not have any line in the wp-config.php file saying anything similar to DEBUG…

    From the admin section, in the Guide page, if I view page, I see the page i should see, with the navigation bar, and the information of the page (which mainly contains a pdf embedded).

    adminadminadmin

    (@adminadminadmin)

    I did nothing in the .htaccess file, from the root folder. Is it necessary to set any change?

    adminadminadmin

    (@adminadminadmin)

    I was still checking, and with the following code I got a redirection to localhost/xampp:

    <div class="txt">
    			<h4>Visit our product guide</h4>
    			<a href="<?php bloginfo('template_directory'); ?>/guide" class="boton">View guide</a>
    		</div>

    Hovering over the button, i can see the right location of the files (including guide.php). If I add “.php” following “/guide” I get again the Fatal error:
    Call to undefined function get_header() in C:\xampp\htdocs\..\guide.php on line 7.

    Any new idea?

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Modifying nav-menu from localhost’ is closed to new replies.