Plugins not working in my custom theme

Discussion in 'WordPress' started by sabahat, Nov 27, 2014.

  1. #1
    okay so I have just started developing my Wordpress theme. I noticed some plugins were not working so after some research I found out I need to add wp_head, wp_footer, wp_enqueue_script hooks for some plugin to work. After that some plugins actually started working but this particular plugin https://wordpress.org/plugins/wpmbytplayer/ is still not working but it works on other default themes that means my custom theme is still missing something.
    the demo custom theme is here : goo.gl/Pz1QuK

    Kindly help me out. Many thanks
     
    sabahat, Nov 27, 2014 IP
  2. Naina S

    Naina S Active Member

    Messages:
    203
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    93
    #2
    your theme should contain all basic pages of wordpress -
    1. header.php
    2. footer.php
    3. functions.php
    4. index.php
    5. page.php

    Basic structure of header.php
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <?php wp_head(); ?>
    <link rel="icon" type="image/png" href="<?php echo get_stylesheet_directory_uri(); ?>/Images/favicon.ico" />
    </head>
    <body <?php body_class(); ?>>
    <div class="bar">
    <div class="barInner"><a class="phone" href="#">Call Us 3156814499 | </a>
    Shop Hours: M-F 11am -10pm Sat 12pm-6pm</div>
    </div>
    <div id="header" class="header">
    <div>
    <div id="leftHeaderDiv">
    <a id="logo" href="<?php echo esc_url( home_url( '/' ) ); ?>">
    <img src="<?php echo get_stylesheet_directory_uri() ?>/Images/chamingbeautyhair.png" alt="charming beauty hair" />
    </a>
    </div>
    <div id="rightHeaderDiv">
    <a href="http://www.facebook.com/CharmingBeautyHairCompany" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/facebook.png" alt="facebook" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/twitter.png" alt="twitter" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/vimeo.png" alt="vimeo" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/youtube.png" alt="youtube" /></a>
    </div>
    </div>
    <div id="navigation">
    <?php

    $defaults = array(
    'theme_location' => '',
    'menu' => '',
    'container' => '',
    'container_class' => '',
    'container_id' => '',
    'menu_class' => 'menu',
    'menu_id' => '',
    'echo' => true,
    'fallback_cb' => 'wp_page_menu',
    'before' => '',
    'after' => '',
    'link_before' => '',
    'link_after' => '',
    'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
    'depth' => 0,
    'walker' => ''
    );

    wp_nav_menu( $defaults );

    ?>
    </div>
    </div>

    basic structure of footer.php
    <div id="footer" class="footer">
    <div>
    <div class="first">
    <h3>Company</h3>
    <ul>
    <li>
    <a href="#">Home</a>
    </li>
    <li>
    <a href="#">Shop</a>
    </li>
    <li>
    <a href="#">Policy</a>
    </li>
    <li>
    <a href="#">About Us</a>
    </li>
    <li>
    <a href="#">Contact</a>
    </li>
    </ul>
    <h3>Receive Exclusive Offers To Your Email</h3>
    <ul>
    <li>
    <input type="text"/>
    </li>
    <li>&nbsp;</li>
    <li>
    <input type="submit" value="Submit"/>
    </li>
    </ul>
    </div>
    <div class="second">
    <h3>Like Us on Facebook</h3>
    <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FCharmingBeautyHairCompany&amp;width&amp;height=258&amp;colorscheme=light&amp;show_faces=true&amp;header=false&amp;stream=false&amp;show_border=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:258px;" allowTransparency="true"></iframe>
    </div>
    <div class="third">
    <h3>Follow Us</h3>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/facebook-icon.png" alt="facebook" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/twitter-icon.png" alt="twitter" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/googleplus-icon.png" alt="google plus" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/instagram-icon.png" alt="instagram" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/pinterest-icon.png" alt="pinterest" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/youtube-icon.png" alt="youtube" /></a>
    <a href="" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/vimeo-icon.png" alt="vimeo" /></a>
    <a href="mailto:" target="_blank"><img src="<?php echo get_stylesheet_directory_uri() ?>/Images/email-icon.png" alt="email" /></a>
    <h3>Connect With us on Instagram</h3>
    <a>
    <img src="<?php echo get_stylesheet_directory_uri() ?>/Images/fp1.jpg" width="75" height="75"/>
    </a>
    <a>
    <img src="<?php echo get_stylesheet_directory_uri() ?>/Images/fp2.jpg" width="75" height="75"/>
    </a>
    <a>
    <img src="<?php echo get_stylesheet_directory_uri() ?>/Images/fp3.jpg" width="75" height="75"/>
    </a>
    <a>
    <img src="<?php echo get_stylesheet_directory_uri() ?>/Images/fp4.jpg" width="75" height="75"/>
    </a>
    <a>
    <img src="<?php echo get_stylesheet_directory_uri() ?>/Images/fp5.jpg" width="75" height="75"/>
    </a>
    <a>
    <img src="<?php echo get_stylesheet_directory_uri() ?>/Images/fp6.jpg" width="75" height="75"/>
    </a>
    </div>
    </div>
    </div>
    <div id="footerDown">
    <span>The Fashion Point Online Store @ 2014, All Rights Reserved </span>
    </div>
    </div>
    <?php wp_footer(); ?>
    </body></html>

    basic structure of index.php
    <?php get_header(); ?>
    <div class="body">
    <div class="bodyInner">
    <div class="featured">
    <div class="gallery">
    <?php
    $posts_per_page = get_option('posts_per_page');
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('posts_per_page=' . $posts_per_page . '&paged=' . $paged);
    while (have_posts()) : the_post();
    ?>
    <div
    <?php post_class('blog'); ?>>
    <h2>
    <a href=""
    <?php the_permalink(); ?>">
    <?php the_title(); ?>
    </a>
    </h2>
    <div>
    <?php the_date('l, F j, Y');?>
    </div>
    <p class="right height200">
    <a href=""
    <?php the_permalink(); ?>" class="paddingLeft10">
    <?php the_post_thumbnail(array(150,150)); ?>
    </a>
    </p>
    <p>
    <?php echo get_the_content();?>
    </p>
    <p>
    <img src=""<?php echo get_stylesheet_directory_uri('stylesheet_directory'); ?>/Images/post-divider.png" alt="divider" />
    </p>
    </div>
    <?php
    endwhile;
    ?>
    <?php content_nav( 'nav-below' ); ?>
    </div>
    <div class="category">
    <?php get_sidebar(); ?>
    </div>
    </div>
    </div>
    </div>
    <?php get_footer(); ?>
     
    Naina S, Nov 27, 2014 IP