Skip to content

Commit

Permalink
delet som file
Browse files Browse the repository at this point in the history
  • Loading branch information
tahanialhammad committed Mar 26, 2021
1 parent 7eda1b2 commit 5d2a3d2
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 14 deletions.
53 changes: 42 additions & 11 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,38 +95,69 @@ function my_footer()


//Custom Post Types
function my_first_post_type()
// function my_first_post_type()
// {
// $args= array(
// 'labels' => array(
// 'name' => 'Cars',
// 'singular_name' => 'car'
// ),
// 'hierarchical' => true,
// 'public' => true,
// 'has_archive' => true,
// 'menu_icon' => 'dashicons-images-alt2',
// 'supports' => array('title', 'editor', 'thumbnail', 'custom-fields')
// );
// register_post_type( 'cars', $args );
// }
// add_action('init', 'my_first_post_type');

function my_projects_post_type()
{
$args= array(
'labels' => array(
'name' => 'Cars',
'singular_name' => 'car'
'name' => 'Projects',
'singular_name' => 'Project'
),
'hierarchical' => true,
'public' => true,
'has_archive' => true,
'menu_icon' => 'dashicons-images-alt2',
'supports' => array('title', 'editor', 'thumbnail', 'custom-fields')
'supports' => array('title', 'editor', 'thumbnail', 'custom-fields'),
);
register_post_type( 'cars', $args );
register_post_type( 'projects', $args );
}
add_action('init', 'my_first_post_type');
add_action('init', 'my_projects_post_type');


//Taxonomy
function my_first_taxonomy()
// function my_first_taxonomy()
// {
// $args= array(
// 'labels' => array(
// 'name' => 'Brands',
// 'singular_name' => 'Brand'
// ),
// 'public' => true,
// 'hierarchical' => true,
// );
// register_taxonomy( 'brands', array('cars'), $args );
// }
// add_action('init', 'my_first_taxonomy');

function my_projects_taxonomy()
{
$args= array(
'labels' => array(
'name' => 'Brands',
'singular_name' => 'Brand'
'name' => 'Topics',
'singular_name' => 'Topic'
),
'public' => true,
'hierarchical' => true,
);
register_taxonomy( 'brands', array('cars'), $args );
register_taxonomy( 'topics', array('projects'), $args );
}
add_action('init', 'my_first_taxonomy');
add_action('init', 'my_projects_taxonomy');

/* Register Custom Navigation Walker */
function register_navwalker(){
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions single-cars.php → single-projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<div class="row">
<div class="col-lg-6">
<?php get_template_part('includes/section', 'cars') ?>
<?php get_template_part('includes/section', 'projects') ?>
<!-- post block -->
<?php wp_link_pages(); ?>
</div>
Expand All @@ -23,10 +23,10 @@
<li>Registration : <?= get_post_meta( $post->ID, 'Registration', true )?></li>
<?php endif; ?>
</ul> -->
<ul>
<!-- <ul>
<li>Color: <?php the_field('color'); ?></li>
<li>Registration : <?php the_field('registration'); ?></li>
</ul>
</ul> -->
</div>
</div>

Expand Down

0 comments on commit 5d2a3d2

Please sign in to comment.