1

I am trying to convert a html page to wordpress but I am stuck on a few issues.

  1. Images I add to gallery and try to display on the pages don't appear.
  2. Slideshow doesn't appear.

Note:If I use the wp default themes like twenty fourteen the above appear.

I have tried using the default gallery,wp filebase plugin and jssor slider plugins

In my ABOUT THE CONFERENCE page I have the shortcode

[jssorslider id=1]

My page appears as below: enter image description here

My functions.php page is as below:

<?php
if ( ! function_exists( 'masterpiece_setup' ) ) :

function masterpiece_setup() {

    /*
     * Make theme available for translation.
     * Translations can be filed in the /languages/ directory.
     */
    load_theme_textdomain( 'masterpiece', get_template_directory() . '/languages' );

    // Add default posts and comments RSS feed links to head.
    add_theme_support( 'automatic-feed-links' );

    /*
     * Let WordPress manage the document title.
     */
    add_theme_support( 'title-tag' );    



    add_theme_support( 'html5', array(
        'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
    ) );


    add_theme_support( 'post-formats', array(
        'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'
    ) );

    // Add menus.
    register_nav_menus( array( 'primary' => __( 'Primary Menu',  'masterpiece' )) );

    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 320, 320 );
    add_image_size('about',300,240,true);
    add_image_size('Investment',400,300,true);


}
endif; // masterpiece_setup

add_action( 'after_setup_theme', 'masterpiece_setup' );




if ( ! function_exists( 'masterpiece_init' ) ) :

function masterpiece_init() {

    register_post_type('investment_item', array(
        'labels' => 
            array(
                'name' => __( 'Investment items' ),
                'singular_name' => __( 'Investment item' )
            ),
        'public' => true,
        'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'post-formats' )
    ));
    register_post_type('download_item', array(
        'labels' => 
            array(
                'name' => __( 'Download items' ),
                'singular_name' => __( 'Download item' )
            ),
        'public' => true,
        'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'post-formats' )
    ));


}
endif; // masterpiece_setup

add_action( 'init', 'masterpiece_init' );


if ( ! function_exists( 'masterpiece_widgets_init' ) ) :

function masterpiece_widgets_init() {

     register_sidebar( array(
        'name' => 'Footer Links', 
        'id'   =>'footer-sidebar-1',
        'before_widget'  => '<div class="row">',
        'after_widget'   => '</div>',
        'before_title'  => '<h4 style="color:#d5a253;text-align:center">',
        'after_title'   => '</h4>',
    ) );

     register_sidebar( array(
        'name' => 'Downloads', 
        'id'   =>'downloads',
        'before_widget'  => '<div class="row align-center">',
        'after_widget'   => '</div>',
        'before_title'  => '<div class="col-md-2">',
        'after_title'   => '</div>',
    ) );
    /* Pinegrow generated Register Sidebars Begin */

    /* Pinegrow generated Register Sidebars End */
}
add_action( 'widgets_init', 'masterpiece_widgets_init' );
endif;// masterpiece_widgets_init


if ( ! function_exists( 'masterpiece_enqueue_scripts' ) ) :
    function masterpiece_enqueue_scripts() {

        /* Pinegrow generated Enqueue Scripts Begin */

    wp_deregister_script( 'jquery' );
    wp_enqueue_script( 'jquery', get_template_directory_uri() . '/assets/js/jquery-1.11.0.min.js', false, null, true);

    wp_deregister_script( 'jqueryui' );
    wp_enqueue_script( 'jqueryui', get_template_directory_uri() . '/assets/js/jquery-ui-1.10.4.min.js', false, null, true);

    wp_deregister_script( 'timecircles' );
    wp_enqueue_script( 'timecircles', get_template_directory_uri() . '/assets/js/TimeCircles.js', false, null, true);

    wp_deregister_script( 'venobox' );
    wp_enqueue_script( 'venobox', get_template_directory_uri() . '/assets/js/venobox.js', false, null, true);
wp_deregister_style( 'styles' );
    wp_enqueue_style( 'styles', get_template_directory_uri() . '/assets/css/styles.css', false, null, 'all');

    wp_deregister_style( 'queries' );
    wp_enqueue_style( 'queries', get_template_directory_uri() . '/assets/css/queries.css', false, null, 'all');

    /* Pinegrow generated Enqueue Styles End */
     }
    add_action( 'wp_enqueue_scripts', 'masterpiece_enqueue_scripts' );
endif;

require_once "inc\bootstrap\wp_bootstrap_navwalker.php";

?>
6
  • There is nothing here which indicates why you are experiencing this issue. Are you using a custom template for this page?
    – Bill
    Commented Sep 30, 2015 at 11:40
  • @BillyMathews I dont have any custom page templates.In my theme I only have header,footer,index and functions.php pages. Commented Sep 30, 2015 at 12:23
  • So this page will use the index template. I suspect the issue lies there. Please provide the PHP code that is used to output the content (essentially just the wordpress loop - I assume).
    – Bill
    Commented Sep 30, 2015 at 14:50
  • @BillyMathews I don't think I have any loop code for the image on my index as I assumed the pugin plus function code and shortcode on page were all I needed.I'm still a noob in wordpress.Here in my index page pastie-> pastie.org/10453228 Commented Oct 1, 2015 at 6:02
  • @BillyMathews is it possible to use the content as well in the index page?I have upvoted your answer. Commented Oct 1, 2015 at 11:40

1 Answer 1

2

In your comments you mentioned that you are still new to wordpress, and I believe you don't have a full understanding of the template hierarchy. Essentially, wordpress looks for certain templates depending on what post type is being displayed. And if it can't find any, the last resort is always the index.php file. Here is a flowchart that demonstrates wordpress' template hierarchy.

So, now you understand which template is being rendered and why, you may be able to figure out that the reason your images and short codes are not working are because you are using the_excerpt() to output your content. This function automatically removes all short codes and tags. More info on this function here (the wordpress codex).

You may want to create a new template file - perhaps page.php* (refer back to the template hierarchy and you will see that this is the top level generic static page template) and use the_content() inside your loop to echo the content.

* I'm assuming you're displaying a static page, if not use the correct template for the post type you are trying to display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.