• pb_advancis

    (@pb_advancis)


    Hi there,

    i′m working on a one-pager website for a customer with fancy java script and stuff. Everything works fine so far, but now i have to build in an entrance page. Because i don′t like to just put a linked logo on it, i added a minimalistic version of the main menu to the bottom.

    When i now try to link to a specific anchor inside the one-pager, wordpress sends me to the top of it instead of the part i want to.

    (e.g. localhost:8888/project/club#dates – i also tried localhost:8888/project/club/#dates)

    I already searched for some help online, but i didn′t find something that matched.

    I use this function inside my one-page template:

    <?php
    $args = array(
    	'sort_order' => 'ASC',
    	'sort_column' => 'menu_order', //post_title
    	'hierarchical' => 1,
    	'exclude' => '',
    	'child_of' => 0,
    	'parent' => -1,
    	'exclude_tree' => '',
    	'number' => '',
    	'offset' => 0,
    	'post_type' => 'page',
    	'post_status' => 'publish'
    );
    $pages = get_pages($args);
    //start loop
    foreach ($pages as $page_data) {
        $content = apply_filters('the_content', $page_data->post_content);
        $title = $page_data->post_title;
        $slug = $page_data->post_name;
    ?>

    Would be very nice, if someone knows a solution. Thanks in advance. ??

Viewing 1 replies (of 1 total)
  • Thread Starter pb_advancis

    (@pb_advancis)

    No idea, anyone ? :-/

    Regarding to the informations i′ve found the way i set the anchorlinks should be ok, it also works fine inside the onepager, but wordpress somehow seems to “correct” the link for me …

Viewing 1 replies (of 1 total)
  • The topic ‘Linking to anchors from outside one-pager layout’ is closed to new replies.