Why: sticky front page code, shows latest non-sticky on logged-in front page

If you want both logged in and non-logged in user to see the same thing then you only want ‘published’ post status, at least it doesn’t make sense to me to show ‘private’ posts to non-logged in users. Alter you query to include that condition. $most_recent_sticky_post = new WP_Query( array( ‘post_status’ => array( ‘publish’ ), … Read more

How to set a static html front page

Temporarily change permalinks back to the default settings. Create a page template and name it page_home.php. Add this to the file: <?php // Template name: Static Front Page You can add code to display the page content later. Like the contents of the index.php file. Save the file to your theme (or child theme) directory. … Read more

How to best include widget area just on homepage?

Is this expected behaviour? Yes, it is expected behavior. The genesis_register_sidebar() function is just a call to register_sidebar() with a few predefined defaults for $args and a filter named ‘genesis_register_sidebar_defaults’: function genesis_register_sidebar( $args ) { $defaults = (array) apply_filters( ‘genesis_register_sidebar_defaults’, array( ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”><div class=”widget-wrap”>’, ‘after_widget’ => “</div></div>\n”, ‘before_title’ => ‘<h4 class=”widgettitle”>’, … Read more

Prevent other versions of jquery from loading on static front page

Maybe I am on thin ice but lets try. Assuming that you already have the correct jquery version(you want to use) downloaded and copied to a folder. (The same js folder as the jquery.rwdImageMaps.js would be logical imho) Imho you also can delete folowing code part <script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/195723/<?php echo get_stylesheet_directory_uri(); ?>/js/jquery.rwdImageMaps.js”></script> from that front-page.php … Read more

How to set up Custom Post Type archive page as Front page

I was able to solve the issue on https://wordpress.stackexchange.com/users/4771/milo suggestion. For this, I created a drop down menu in theme customizer from where I can select a dummy static page to act as Portfolio Page. I’ve used following code for drop down menu: add_action( ‘customize_register’, ‘th_customize_register’ ); function th_customize_register($wp_customize) { // Add: Drop Down Pages … Read more

All Pages visible on the Frontpage

In Twenty Seventeen you can only add 4 page in front-page section. see image below See Appearance=> Customize => Theme Options Update You can add extra section with filter twentyseventeen_front_page_sections add this code in functions.php function tws_custom_front_sections( $num_sections ) { return 5; //Change this number to change the number of the sections. } add_filter( ‘twentyseventeen_front_page_sections’, … Read more

posts not showing on index.php

The template naming is a bit confusing in this situation, but what is happening is normal behavior in the Template Hierarchy. home.php shows your posts page, whether it’s on the front page, or assigned to another page when using a static front page. If you want your home.php template to be used for your static … Read more

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