Jelajahi Sumber

custom post types, menu order fixed.

Juan Carlos 5 tahun lalu
induk
melakukan
f3fd3379bb

+ 1 - 1
archive-custom_type.php

@@ -69,7 +69,7 @@
 
 						</main>
 
-					<?php get_sidebar(); ?>
+					<?php /* get_sidebar(); */ ?>
 
 				</div>
 

+ 84 - 0
archive-mitarbeiter.php

@@ -0,0 +1,84 @@
+<?php
+/*
+ * CUSTOM POST TYPE ARCHIVE TEMPLATE
+ *
+ * This is the custom post type archive template. If you edit the custom post type name,
+ * you've got to change the name of this template to reflect that name change.
+ *
+ * For Example, if your custom post type is called "register_post_type( 'bookmarks')",
+ * then your template name should be archive-bookmarks.php
+ *
+ * For more info: http://codex.wordpress.org/Post_Type_Templates
+*/
+?>
+
+<?php get_header(); ?>
+
+			<div id="content">
+
+				<div id="inner-content" class="wrap cf">
+
+					<main id="main" class="m-all t-2of3 d-5of7 cf" role="main" itemscope itemprop="mainContentOfPage" itemtype="http://schema.org/Blog">
+
+						<h1 class="archive-title h2"><?php post_type_archive_title(); ?></h1>
+
+							<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
+
+							<article id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?> role="article">
+
+
+								<?php the_post_thumbnail( 'general_thumb' ); ?>
+								<header class="article-header">
+
+
+
+									<h3 class="h2"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
+
+									<?php if ( 0 ): ?>
+									<p class="byline vcard"><?php
+										printf( __( 'Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span>', 'bonestheme' ), get_the_time( 'Y-m-j' ), get_the_time( __( 'F jS, Y', 'bonestheme' ) ), get_author_posts_url( get_the_author_meta( 'ID' ) ));
+									?></p>
+								<?php endif; ?>
+								</header>
+
+								<section class="entry-content cf">
+
+									<?php the_excerpt(); ?>
+
+								</section>
+
+								<footer class="article-footer">
+
+								</footer>
+
+							</article>
+
+							<?php endwhile; ?>
+
+									<?php bones_page_navi(); ?>
+
+							<?php else : ?>
+
+									<article id="post-not-found" class="hentry cf">
+										<header class="article-header">
+											<h1><?php _e( 'Oops, Post Not Found!', 'bonestheme' ); ?></h1>
+										</header>
+										<section class="entry-content">
+											<p><?php _e( 'Uh Oh. Something is missing. Try double checking things.', 'bonestheme' ); ?></p>
+										</section>
+										<footer class="article-footer">
+												<p><?php _e( 'This is the error message in the custom posty type archive template.', 'bonestheme' ); ?></p>
+										</footer>
+									</article>
+
+							<?php endif; ?>
+
+						</main>
+
+					<?php /* get_sidebar();  */ ?>
+
+				</div>
+
+			</div>
+
+<?php get_footer(); ?>

+ 19 - 11
functions.php

@@ -28,7 +28,7 @@ function bones_ahoy() {
   load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );
 
   // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY
-  require_once( 'library/custom-post-type.php' );
+  //require_once( 'library/custom-post-type.php' );
 
   // launching operation cleanup
   add_action( 'init', 'bones_head_cleanup' );
@@ -254,6 +254,14 @@ add_action('wp_enqueue_scripts', 'bones_fonts');
 // ************************************************************  \\
 
 
+
+function post_remove ()      //creating functions post_remove for removing menu item
+{
+   remove_menu_page('edit.php');
+}
+
+add_action('admin_menu', 'post_remove');
+
 // https://blog.teamtreehouse.com/create-your-first-wordpress-custom-post-type
 https://developer.wordpress.org/reference/functions/register_post_type/#capability_type
 
@@ -287,7 +295,7 @@ function mitarbeiter() {
       'public' => true,
       'show_ui' => true,
       'show_in_menu' => true,
-      'menu_position' => 60,
+      'menu_position' => 11,
       'show_in_admin_bar' => true,
       'show_in_nav_menus' => true,
       'can_export' => true,
@@ -330,7 +338,7 @@ function projekte() {
       'public' => true,
       'show_ui' => true,
       'show_in_menu' => true,
-      'menu_position' => 60,
+      'menu_position' => 11,
       'show_in_admin_bar' => true,
       'show_in_nav_menus' => true,
       'can_export' => true,
@@ -375,7 +383,7 @@ function baugruppen() {
       'public' => true,
       'show_ui' => true,
       'show_in_menu' => true,
-      'menu_position' => 60,
+      'menu_position' => 11,
       'show_in_admin_bar' => true,
       'show_in_nav_menus' => true,
       'can_export' => true,
@@ -420,7 +428,7 @@ function clients() {
       'public' => true,
       'show_ui' => true,
       'show_in_menu' => true,
-      'menu_position' => 60,
+      'menu_position' => 11,
       'show_in_admin_bar' => true,
       'show_in_nav_menus' => true,
       'can_export' => true,
@@ -439,8 +447,8 @@ function testimonials() {
    $labels = array(
       'name' => _x('testimonials', 'Post Type General Name', 'theme'),
       'singular_name' => _x('Testimonial', 'Post Type Singular Name', 'theme'),
-      'menu_name' => __('testimonials', 'theme'),
-      'name_admin_bar' => __('testimonials', 'theme'),
+      'menu_name' => __('Testimonials', 'theme'),
+      'name_admin_bar' => __('Testimonials', 'theme'),
       'parent_item_colon' => __('Parent testimonials:', 'theme'),
       'all_items' => __('All testimonials', 'theme'),
       'add_new_item' => __('Add New testimonial', 'theme'),
@@ -464,7 +472,7 @@ function testimonials() {
       'public' => true,
       'show_ui' => true,
       'show_in_menu' => true,
-      'menu_position' => 60,
+      'menu_position' => 11,
       'show_in_admin_bar' => true,
       'show_in_nav_menus' => true,
       'can_export' => true,
@@ -484,8 +492,8 @@ function slides() {
    $labels = array(
       'name' => _x('Slides', 'Post Type General Name', 'theme'),
       'singular_name' => _x('Slide', 'Post Type Singular Name', 'theme'),
-      'menu_name' => __('slides', 'theme'),
-      'name_admin_bar' => __('slides', 'theme'),
+      'menu_name' => __('Slides', 'theme'),
+      'name_admin_bar' => __('Slides', 'theme'),
       'parent_item_colon' => __('Parent slides:', 'theme'),
       'all_items' => __('All slides', 'theme'),
       'add_new_item' => __('Add New slide', 'theme'),
@@ -509,7 +517,7 @@ function slides() {
       'public' => true,
       'show_ui' => true,
       'show_in_menu' => true,
-      'menu_position' => 60,
+      'menu_position' => 11,
       'show_in_admin_bar' => true,
       'show_in_nav_menus' => true,
       'can_export' => true,

+ 1 - 1
index.php.org

@@ -66,7 +66,7 @@
 
 						</main>
 
-					<?php get_sidebar(); ?>
+					<?php /* get_sidebar(); */ ?>
 
 				</div>
 

+ 1 - 1
library/images/nothumb.gif


+ 1 - 1
page.php.old

@@ -58,7 +58,7 @@
 
 						</main>
 
-						<?php get_sidebar(); ?>
+						<?php /* get_sidebar(); */ ?>
 
 				</div>
 

+ 8 - 0
post-formats/format.php

@@ -20,6 +20,7 @@
 
                   <h1 class="entry-title single-title" itemprop="headline" rel="bookmark"><?php the_title(); ?></h1>
 
+                  <?php if ( 0 ): ?>
                   <p class="byline entry-meta vcard">
 
                     <?php printf( __( 'Posted', 'bonestheme' ).' %1$s %2$s',
@@ -30,6 +31,7 @@
                     ); ?>
 
                   </p>
+                  <?php endif; ?>
 
                 </header> <?php // end article header ?>
 
@@ -61,12 +63,18 @@
 
                 <footer class="article-footer">
 
+                  <?php if ( 0 ): ?>
+
                   <?php printf( __( 'filed under', 'bonestheme' ).': %1$s', get_the_category_list(', ') ); ?>
 
                   <?php the_tags( '<p class="tags"><span class="tags-title">' . __( 'Tags:', 'bonestheme' ) . '</span> ', ', ', '</p>' ); ?>
 
+                  <?php endif; ?>
+
                 </footer> <?php // end article footer ?>
 
+
+
                 <?php //comments_template(); ?>
 
               </article> <?php // end article ?>

+ 1 - 1
search.php

@@ -65,7 +65,7 @@
 
 						</main>
 
-							<?php get_sidebar(); ?>
+							<?php /* get_sidebar(); */ ?>
 
 					</div>
 

+ 1 - 1
single-custom_type.php

@@ -91,7 +91,7 @@
 
 						</main>
 
-						<?php get_sidebar(); ?>
+						<?php /* get_sidebar(); */ ?>
 
 				</div>
 

+ 1 - 1
single.php

@@ -45,7 +45,7 @@
 
 					</main>
 
-					<?php get_sidebar(); ?>
+					<?php /* get_sidebar(); */ ?>
 
 				</div>
 

+ 1 - 1
taxonomy-custom_cat.php

@@ -68,7 +68,7 @@
 
 						</main>
 
-						<?php get_sidebar(); ?>
+						<?php /* get_sidebar(); */ ?>
 
 				</div>