Guest User

asdasda

a guest
Nov 6th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. ========== index.php ==========
  2. $menu_name = 'primary';
  3. if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] )) {
  4. $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
  5. $menu_items = wp_get_nav_menu_items($menu->term_id);
  6. }
  7. foreach ( $menu_items as $menu_item ) {
  8. $numbers[] = get_post_meta( $menu_item->ID, '_menu_item_object_id', true );
  9. }
  10. for ($i=0; $i < count($numbers); $i++) {
  11. $id = $numbers[$i];
  12. $post = get_post($id);
  13. $content = apply_filters('the_content', $post->post_content);
  14. echo '<div class="wpis section fp-section-'.$i.'">';
  15. echo '<div class="dupa">';
  16. echo '<h1 class="pagetitle the_post the_page page-'.$id.'">'.get_the_title($id).'</h1>';
  17. echo '<div class="content"><p>'.$content.'</p></div>';
  18. echo '</div>';
  19. echo '</div>';
  20. if (strpos($content,'<p class="wp-more-tag mce-wp-more"') !== false) {
  21. echo '<div id="popup">';
  22. echo $content;
  23. echo '<a href="#" class="more-link-close">Back to home</a>';
  24. echo '</div>';
  25.  
  26. } else {
  27.  
  28. }
  29.  
  30. }
  31.  
  32. ========== skrypty jquery ==========
  33. <script type="text/javascript">
  34. $( ".more-link" ).click(function() {
  35. $( "#popup" ).fadeToggle( "slow","linear", function() {
  36. // Animation complete.
  37. });
  38. });
  39. $( ".more-link-close" ).click(function() {
  40. $( "#popup" ).fadeToggle( "slow","linear", function() {
  41. // Animation complete.
  42. });
  43. });
  44.  
  45.  
  46. ========== CSS ==========
  47. #popup {padding:20px;height:90%;background-color: #ccc; margin: 0 auto; position: fixed; display: none; top:0; left: 20%; overflow: auto; z-index: 99}
  48. #popup .wp-more-tag {display:none;}
Advertisement
Add Comment
Please, Sign In to add comment