Linking to anchors from outside one-pager layout
-
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. ??
- The topic ‘Linking to anchors from outside one-pager layout’ is closed to new replies.