Display DISQUS on homepage

Hook it in from your child themes functions file or add the template tag to a front-page.php file Untested add_action(‘loop_end’,’disqus_front_page_after_loop’); function disqus_front_page_after_loop() { if (is_front_page() && function_exists( ‘comments_template’ ) ) { comments_template(); } } Change the loop_end hook to another WordPress or theme specific hook. If using the template tag, you might want to try … Read more

2 Categories using same template but one has a problem? [closed]

This question as mentioned in the comments is not related to wordpress by any means. But anywho remove the float on your #portfolio-item and add some flex like its 2015. #contentportfolio { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; } People still play sims?

WordPress “Posts Page” isn’t showing template dropdown

Ben, Welcome to StackExchange! Page Templates are only able to be defined in the Page post type (“Pages” in the WP-admin). https://developer.wordpress.org/themes/template-files-section/page-template-files/#uses-for-page-templates You can edit your theme (or create a child theme) to define how your post pages are displayed. Depending on your needs you could define an archive.php, category.php or index.php in your theme … Read more

CPT Template Option to Top

You could hook into theme_{$post_type}_templates and add an identical “default” option at the end: add_action(‘theme_page_templates’, ‘wpse_296283_theme_page_templates’); function wpse_296283_theme_page_templates($post_templates){ $post_templates[‘default’] = “Default Template”; return $post_templates; } Then you’d hide the first one with CSS: add_action(‘admin_head’ ‘wpse_296283_admin_head’); function wpse_296283_admin_head(){ ?> <style>#page_template option:first-child {display: none;}</style> <?php }

Enclose article’s body with default shortcode

Thanks to @kero I have implemented this code: <?php echo do_shortcode(‘[responsivevoice voice=”Italian Female” buttontext=”Ascolta”]’.'<br>’.$bodyContent.'[/responsivevoice]’); ?> The $bodyContent variable contains the HTML value of the article’s body, obtained using this function: http://www.web-templates.nu/2008/08/31/get_the_content-with-formatting/index.html <?php $bodyContent = get_the_content_with_formatting(); ?>

custom post type single page template not working

Please see the Template Hierarchy. There is no template-portfolio.php template. It needs to be archive-portfolio.php. Also, you should not be using a custom query*. Use the main query in your post type archive templates. WordPress already queries the correct posts for you. So remove: $portfolio = new WP_Query(‘post_type’=> ‘portfolio’); And replace: while ($portfolio-> have_posts() ) … Read more

Force template on page load

This question is quite difficult to understand. Do you mean you want to make generic template pages Programmatically? There are a few ways to do this. If you have a page built on the backend, you can create a file within your theme folder called page-{page-name}.php. For instance, for a page called about, you should … Read more

Custom template not working for existing pages [closed]

as a solution, you can fully automate the selection of a template for a group of pages using slug names: add_filter(‘request’, function( $vars ) { $slug = explode(“https://wordpress.stackexchange.com/”, explode(‘?’, $_SERVER[‘REQUEST_URI’])[0]); array_pop ($slug); $temp_base = “…first_part_template_name…”; $temp_slug = array_pop ($slug); if (file_exists(get_template_directory().”https://wordpress.stackexchange.com/”.$template.’-‘.$temp_cat.’.php’)) { get_template_part( $temp_base, $temp_slug ); } }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)