puresimple_*() functions not working
Home › Forums › WordPress Themes – Premium › Pure & Simple › puresimple_*() functions not working
- This topic has 9 replies, 27 voices, and was last updated 7 years, 11 months ago by
Tom Fikes.
-
AuthorPosts
-
April 22, 2015 at 6:47 am #16065
Tom Fikes
MemberI 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.
April 22, 2015 at 7:01 am #21235Tom Fikes
Membera quick follow-up: template-tags.php, where the functions are defined, is in the inc folder in the child theme.
April 22, 2015 at 9:48 am #21236Shekhar Bhandari
ParticipantHi Tom Fikes,
Can you provide the link to your site so we could exactly give you the solution.
Thanks.
April 22, 2015 at 1:06 pm #21237Shekhar Bhandari
ParticipantHi Tom Fikes,
Please provide us the screenshot too where you face the problem.
Thanks.
April 22, 2015 at 7:33 pm #21238Tom Fikes
Memberthe 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,
-tomecho 'content single 1'; <article id="post-" >
<?php the_title( ' ', '
' ); ?> echo 'content single 2';echo 'content single 3'; echo 'content single 4';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 ''; the_post_thumbnail(); echo ''; } endif; ?> echo 'content single 6'; echo 'content single 7'; echo 'content single 8';singlepost1.jpg
singlepost2.jpgAttachments:
You must be logged in to view attached files.April 22, 2015 at 9:46 pm #21240Tom Fikes
Memberscreen 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.jpgAttachments:
You must be logged in to view attached files.April 23, 2015 at 8:21 am #21242Shekhar Bhandari
ParticipantHi 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
April 23, 2015 at 8:33 am #21243Tom Fikes
Memberthe 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';
April 23, 2015 at 9:24 am #21244Shekhar Bhandari
ParticipantHi 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_ThemesThanks.
April 23, 2015 at 9:52 am #16066Tom Fikes
Memberthanks 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 -
AuthorPosts
- You must be logged in to reply to this topic.