StyledThemes

puresimple_*() functions not working

Home Forums WordPress Themes – Premium Pure & Simple puresimple_*() functions not working

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #16065
    Tom Fikes
    Member

    I inherited a website project from a branding company who used P&S free as the foundation for a custom site. I purchased the P&Spro, and am building a child theme (rather than just hacking the main theme code as the branding company did). It’s looking good, and I love the theme… but I’ve run into a problem on single blog posts not displaying any content. I’ve traced the problem through single.php to content-single.php — the script fails at the point where the first puresimple_* function, puresimple_posted_on(), occurs. If I remove that line, it fails at the second puresimple_* function, puresimple_multi_pages().

    If I switch from my child theme back to the P&Spro theme, the single post content displays just fine.

    Any hints on where to look for the omission/insertion that I’ve made that is causing my problems?

    Thanks in advance.

    #21235
    Tom Fikes
    Member

    a quick follow-up: template-tags.php, where the functions are defined, is in the inc folder in the child theme.

    #21236
    Shekhar Bhandari
    Participant

    Hi Tom Fikes,

    Can you provide the link to your site so we could exactly give you the solution.

    Thanks.

    #21237
    Shekhar Bhandari
    Participant

    Hi Tom Fikes,

    Please provide us the screenshot too where you face the problem.

    Thanks.

    #21238
    Tom Fikes
    Member

    the site is hosted locally for development, and is not live yet. here is a screenshot of the single post page for one of my posts, echoing ‘content single n’ (n=1 to 8 ) so that I could track down the point at which the php code stopped working. that is in my chile theme. also attached is a screenshot of the page after I switch to the parent theme. the code for content-single.php is pasted below in its entirety. It is identical to the content-single.php code in the parent theme, other than my echo statements.

    As you can see, php puresimple_posted_on() does not execute in the child theme (and if that line is removed, the code fails on the next puresimple_ function call).

    I’m not sure what screenshots would be useful to you… the directory structure of the parent and child themes? Please let me know and I will pos those.

    Thanks,
    -tom

    
    echo 'content single 1';
    <article id="post-" >
    	
    <?php the_title( '

    ', '

    ' ); ?> echo 'content single 2';
    echo 'content single 5'; <?php // do not show featured image if post is paged $paged = get_query_var( 'page' ) ? get_query_var( 'page' ) : false; if ( $paged === false ): if ( has_post_thumbnail() ) { echo ''; } endif; ?> echo 'content single 6'; echo 'content single 7'; echo 'content single 8';
    <?php if (get_the_modified_time() != get_the_time()) : _e( 'Last Modified on ', 'pure-and-simple' ); the_modified_date() ; echo '
    '; endif; /* translators: used between list items, there is a space after the comma */ $category_list = get_the_category_list( __( ', ', 'pure-and-simple' ) ); /* translators: used between list items, there is a space after the comma */ $tag_list = get_the_tag_list( '', __( ', ', 'pure-and-simple' ) ); $parent_title = get_the_title( $post->post_parent ); if ( ! puresimple_categorized_blog() ) { // This blog only has 1 category so we just need to worry about tags in the meta text if ( '' != $tag_list ) { $meta_text = __( 'This entry was tagged with %2$s
    this article ', 'pure-and-simple') . $parent_title . '
    '; } else { $meta_text = __( 'this article ', 'pure-and-simple' ) . $parent_title . '
    '; } } else { // But this blog has loads of categories so we should probably display them here if ( '' != $tag_list ) { $meta_text = __( 'This entry was posted in %1$s
    Tagged with %2$s
    Bookmark this article ', 'pure-and-simple' ) . $parent_title . '
    '; } else { $meta_text = __( 'This entry was posted in %1$s
    Bookmark this article ', 'pure-and-simple' ) . $parent_title . '
    '; } } // end check for categories on this blog printf( $meta_text, $category_list, $tag_list, get_permalink() ); ?> <?php edit_post_link( __( 'Edit This Post', 'pure-and-simple' ), '', '' ); ?>

    singlepost1.jpg
    singlepost2.jpg

    Attachments:
    You must be logged in to view attached files.
    #21240
    Tom Fikes
    Member

    screen shots of my file structure, for the parent and child themes… in case that helps. I’ve tried to include as much information as possible in these shots, expanding to the inc (which holds the template-tags.php file) directory in both cases.

    ps-child1.jpg
    ps-child2.jpg
    ps1.jpg
    ps2.jpg

    Attachments:
    You must be logged in to view attached files.
    #21242
    Shekhar Bhandari
    Participant

    Hi Tom Fikes,

    It seems you have copied all the parent theme files to the child theme file, is that right? Have you copied the styled.css and functions.php file too. as the code that you provide is working on my computer.

    Thanks

    #21243
    Tom Fikes
    Member

    the functions.php and style.css were significantly modified when I inherited the project, and I have continued to develop those. Since the content-single.php file is identical to the parent, I imagine that it would work just fine… the problem is that the functions it calls (e.g., puresimple_posted_on) are not executing, even though the template-tags.php file where they are defined is present. Might there be something in the functions.php that is preventing those puresimple_* functions from working?

    I’m pasting the functions.php code from my child theme here in case that’s useful:

     __( 'Primary Menu', 'pure-and-simple' ),
                                  'header' => __( 'Header Menu', 'pure-and-simple' ),	 /* -TGF */
                                  'footer' => __( 'Footer Menu', 'pure-and-simple' ),
                                  ) );
        
        /*
         * Switch default core markup for search form, comment form, and comments
         * to output valid HTML5.
         */
        add_theme_support( 'html5', array(
                                          'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
                                          ) );
        
        /*
         * Enable support for Post Formats.
         * See http://codex.wordpress.org/Post_Formats
         */
        add_theme_support( 'post-formats', array(
                                                 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio'
                                                 ) );
        
        // Setup the WordPress core custom background feature.
        add_theme_support( 'custom-background', apply_filters( 'puresimple_custom_background_args', array(
            'default-color' => '3d4147',
            'default-image' => get_template_directory_uri() . '/images/page-bg.jpg',
        ) ) );
    }
    endif; // puresimple_setup
    add_action( 'after_setup_theme', 'puresimple_setup' );
    
    /** tgf added from brandspeak's functions.php
     * Enqueue scripts and styles.
     */
    function puresimple_scripts() {
        
        wp_enqueue_style( 'puresimple-responsive', get_template_directory_uri() . '/css/responsive.min.css', array( ), '3.1.1' );
        wp_enqueue_style( 'puresimple-fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.2.0' );
        wp_enqueue_style( 'puresimple-opensans', get_template_directory_uri() . '/css/font-opensans.css', array(), '1.0.2' );
        wp_enqueue_style( 'puresimple-style', get_stylesheet_uri() );
        
        wp_enqueue_script( 'puresimple-global', get_template_directory_uri() . '/js/global.min.js', array( 'jquery' ), '20141001', true );
        
        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
            wp_enqueue_script( 'comment-reply' );
        }
    }
    add_action( 'wp_enqueue_scripts', 'puresimple_scripts' );
        
    /** These requries are from the BrandSpeak functions.php, and add menu options in the Appearance>Customize admin menu -TGF 
    **/
    /**
     * Implement the Custom Header feature.
     */
    require get_template_directory() . '/inc/custom-header.php';
    
     /**
     * Customizer additions.
     */
    require get_template_directory() . '/inc/customizer.php';
    
    /**
     * Load widgets.
     */
    require get_template_directory() . '/inc/widgets.php';
    
    /**
     * Get inline CSS.
     * If you need to edit this file, open the unminified version of the inline-css.php file.
     */
    require get_template_directory() . '/inc/inline-css.min.php';
    
    /**
     * Load Jetpack compatibility file.
     */
    require get_template_directory() . '/inc/jetpack.php';
    #21244
    Shekhar Bhandari
    Participant

    Hi Tom,

    There is no need to copy all the functions.php file to child theme functions.php, if i look up to your child theme functions.php and there are many part which are not necessary to mention as it’s already on the parent theme file. please have a look at this link it will help you for which file to copy and which not to.
    https://codex.wordpress.org/Child_Themes

    Thanks.

    #16066
    Tom Fikes
    Member

    thanks for your help. I can get other parts of my site to break by removing files, but removing files doesn’t seem to solve the problem with the nonfunctional puresimple_ functions. clearly there is something preventing the functions in template-tags.php from executing. I’ll keep searching for what that is.

    thanks for your time,
    -tom

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.