Wordpress
Install Custom Fields Plugin Instead?
Search for Advanced Custom Fields on Plugins Admin ACF the_field(); the_field(‘event_date’); event_date is created on ACF
After Registering Custom-Fields under MU-Plugins Turn On Additional Fields
Go to edit a page of (in this case ‘Eventes’) Got to Edit 3Dots TOP Right Choose Preferences/ Choose Panels/
register_post_type() Add excerpt ‘supports’ => array(‘title’, ‘editor’, ‘excerpt’),
On custom_post_types.php page created under themes/mu-plugins
if (has_excerpt()) the_excerpt() II
This is the excerpt form the actual post, written in admin
Create New archive-event.php page
This page will show when going to main url/events/
Let’s Create a custom page for Events single-event.php
Under theme/ create anew page single-event.php
Must Use Plugins / mu-plugins folder
Any Plugin that we create under this folder will be automatically called by wordpress. Under wp-content folder, create mu-plugins folder
Custom Post Type Create New Event Section
Under functions.php page register new Post Type problem with this is taht if you change theme’s this would dissapear, so
(get_post_type() ==’post’)
<li <?php if (get_post_type() ==’post’) echo ‘class=”current-menu-item”‘?>><a href=”<?php echo site_url(‘/blog’); ?>”>Blog</a></li>
the_excerpt() VS wp_trim_words()
<?php echo wp_trim_words(get_the_content(), 18) ?> <?php the_excerpt(); ?>
echo paginate_links()
The beauty of echo paginate_links() Automatically create a pagination system for Blog, now index.php;
the_author_posts_link()
You can change how your author name looks under Users/Your Profile