PHP 7 – Class Method Compatibility Issue

Can anyone help me to determine what function/statement in this file causes the fatal error after upgrading to php 7.0? On php 5.6 everything works fine. Error: “Declaration of theme_navigation::update() should be compatible with WP_Widget::update($new_instance, $old_instance)” on line 0 Code: class theme_navigation extends WP_Widget { public function __construct() { parent::__construct( ‘theme_navigation’, // Base ID ‘Child … Read more

Force Flutter navigator to reload state when popping

I have one StatefulWidget in Flutter with button, which navigates me to another StatefulWidget using Navigator.push(). On second widget I’m changing global state (some user preferences). When I get back from second widget to first, using Navigator.pop() the first widget is in old state, but I want to force it’s reload. Any idea how to … Read more

Menu styling for last menu item

okay so I’m using the following code to get my links… <?php wp_nav_menu( array(‘theme_location’ => ‘primary’, ‘container’ => ”, ‘menu_class’ => ‘mainnav’) ); ?> This is my CSS for the nav… .mainnav a { font-family: gooddog_plainregular, Arial, sans-serif; font-size: 30px; color: #ffea00; text-decoration:none; } .mainnav li:after { content: url(‘images/nav-divider.png’); } .mainnav li.last:after { content: none; … Read more

Using query_posts inside single.php loop

Inside of my loop in single.php, I used a custom query using get_posts to return posts belonging to a certain category. <?php global $post; $paged = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1; $myposts = get_posts(“paged=$paged&category=5”);?> <?php foreach($myposts as $post) :?> <?php the_title();?> <?php endforeach; ?> The problem is that the original loop, … Read more

Add custom text to menu

How i can add custom text to menu? I want such structure in output: <ul> <li>home</li> <li>services <ul> <p>services</p> <li><a href=”#”>service1</a></li> <li><a href=”#”>service2</a></li> <li><a href=”#”>service3</a> <ul> <p>service3<p> <li><a href=”#”>service 3.1</a></li> <ul> </li> </ul> </li> </ul> Thanks! 3 Answers 3 There is another alt way to do this with CSS3. You would add a link to … Read more

Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?

I’ve found this new plugin http://wpsmith.net/wordpress/creating-multiple-custom-menus-in-wordpress-3-1 that is using a new 3.1 hook (wp_nav_menu_objects) to remove specific nav-menu-items from the nav-menu-item array before they are parsed by the walker class, if a user isn’t logged in. The plugin uses a specific CSS-class as identifier to decide which items to remove. So I’ve been wondering if … Read more

Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu

I have created a hierarchical custom post type called events and have used wp_list_pages to list the sub-posts for each event post (See below). This navigation works great, but I cannot figure out how to highlight the menu items based on the post being viewed. I normally use .current_menu_item, but this class is not generated … Read more