Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ========== index.php ==========
- $menu_name = 'primary';
- if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] )) {
- $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
- $menu_items = wp_get_nav_menu_items($menu->term_id);
- }
- foreach ( $menu_items as $menu_item ) {
- $numbers[] = get_post_meta( $menu_item->ID, '_menu_item_object_id', true );
- }
- for ($i=0; $i < count($numbers); $i++) {
- $id = $numbers[$i];
- $post = get_post($id);
- $content = apply_filters('the_content', $post->post_content);
- echo '<div class="wpis section fp-section-'.$i.'">';
- echo '<div class="dupa">';
- echo '<h1 class="pagetitle the_post the_page page-'.$id.'">'.get_the_title($id).'</h1>';
- echo '<div class="content"><p>'.$content.'</p></div>';
- echo '</div>';
- echo '</div>';
- if (strpos($content,'<p class="wp-more-tag mce-wp-more"') !== false) {
- echo '<div id="popup">';
- echo $content;
- echo '<a href="#" class="more-link-close">Back to home</a>';
- echo '</div>';
- } else {
- }
- }
- ========== skrypty jquery ==========
- <script type="text/javascript">
- $( ".more-link" ).click(function() {
- $( "#popup" ).fadeToggle( "slow","linear", function() {
- // Animation complete.
- });
- });
- $( ".more-link-close" ).click(function() {
- $( "#popup" ).fadeToggle( "slow","linear", function() {
- // Animation complete.
- });
- });
- ========== CSS ==========
- #popup {padding:20px;height:90%;background-color: #ccc; margin: 0 auto; position: fixed; display: none; top:0; left: 20%; overflow: auto; z-index: 99}
- #popup .wp-more-tag {display:none;}
Advertisement
Add Comment
Please, Sign In to add comment