Can site visitors view functions.php file?

It’s always difficult to prove that something isn’t there, like the famous teapot circling the earth. So you’ll have to trust me that the WordPress source code does not have any functions that might display its own php files. That said, it would be easy to write such code. So, if you install plugins of … Read more

How to add javascript code into Divi child theme?

You’re almost there, change code in functions.php to: <?php function my_theme_enqueue_styles() { $parent_style=”divi-style”; wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ ); wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( $parent_style ), wp_get_theme()->get(‘Version’) ); wp_enqueue_script( ‘et_mobile_nav_menu’, get_stylesheet_directory_uri() . ‘/js/selectpage.js’, array( ‘jquery’ ), true ); } add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ ); ?> Now your script should be located at: /wp-content/themes/divi-child/js/selectpage.js

Show image after X para – center aligned

You need to tell WordPress about the centre aligned HTML or style you wish to use. I would do this: $content = preg_replace( “/<\/p>/”, “</p><div style=”margin:auto;textalign:center;”>” . get_the_post_thumbnail($post->ID, ‘post-single’) . “</div>”, $content, 1 ); or better yet: $content = preg_replace( “/<\/p>/”, “</p><div class=”center”>” . get_the_post_thumbnail($post->ID, ‘post-single’) . “</div>”, $content, 1 ); You would need to … Read more