Giter Site home page Giter Site logo

inhabitent's Introduction

Inhabitent

Custom Wordpress Template Site

Technologies used

Media Query

Device Width Height
Desktop 1240 1000

Personal Learnings

Wordpress:

This was the first time I used the CMS Wordpress to create a functional site with mulitple pages. I set-up my account then customised the Dashboard with the pages, posts and necessary plugins we would be using.

Plugins:

Ajax Search Lite
Advanced Custom Fields
Query Monitor

PHP / Wordpress:

We were introduced to the general-purpose scripting language PHP (Personal Home Page). Using this language I leanred how to connect my Wordpress content into my Custom Theme using the built in PHP/Wordpress functions. Below I use the Built in PHP functions to grab the data for each product and have is displayed accordingly onto its correct page.

<a href="<?php echo get_permalink() ;?>">
        <figure>
        <?php the_post_thumbnail('large');?>
        <figcaption>
            <p><?php the_title(); ?></p>
            <?php echo "£" . get_field('price');?>
        </figcaption>
        </figure>
</a>

Below I used a PHP '''foreach''' to loop through my taxonomy products and grab the appropriate slug, to be appended to the URL of the images path Im looking for within my project directory. Then, I also add the correct category discription and button link to that products page based on the $term

CODE:

foreach($terms as $term):?>

    <section class="front-page-product-sections">
        <img class="product-section-svg" src="<?php echo get_stylesheet_directory_uri();?>/assets/images/product-type-icons/<?php echo $term->slug;?>.svg" alt="">
         <?php echo category_description($term);?>
        <a href="<?php echo "product-type/" . $term->slug ;?>"><button type="submit" class="front-page-product-sections-btn"><?php echo $term->name;?></button></a>
    </section>

<?php endforeach;?>

RESULT:

Below Is the code I used to grab my custom wordpress widget, in this case it was the sidebar that appears on a few, but not all of the pages. I accessed my widget through my funcions.php file after creating it on the wordpress dashboard.

CODE:

function inhabitent_widgets(){
    register_sidebar( array(
        'name'          => sprintf( __( 'Sidebar %d' ), 1 ),
        'id'            => "sidebar-1",
        'description'   => '',
        'class'         => '',
        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
        'after_widget'  => "</aside>\n",
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => "</h2>\n",
    ));
}

Then in the pages I wanted my sidebar to appear I used..

<?php get_sidebar();?>

..at the end of my script, to add the sidebar to the pages I wanted it to appear. Then appended it to its grid-area: a; place accordingly in my SCSS file.

Result:

Environment

  • macOS Mojave: 10.14.6
  • VS Code: 1.39.1

Authors

  • Bruce Pouncey - Initial work - BPouncey

License

(MIT)

Acknowledgments

RED Academy

inhabitent's People

Contributors

dependabot[bot] avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.