Marko Jakic
Forum Replies Created
-
Forum: Plugins
In reply to: [Awesome Sticky Header by DevCanyon] Include search box does not appearHi what is your website url?
Forum: Hacks
In reply to: WP 4.4: remove json-api and X-Pingback from HTTP HeadersTo remove X-Pingback starting from WordPress version 4.4 you could do this:
add_action('wp', function() { header_remove('X-Pingback'); }, 1000);
It’s hardcoded in wp-includes/class-wp.php in handle_404 function, so you’d need to hook as late as possible to remove this header.
Is it working now? I see it looks good.
There are filters available in this plugin, like
asmh_middle_menu_before
andasmh_middle_menu_after
, which means to put HTML content before or after main menu.So to put anything before the main menu and to float it right, you can do this:
add_filter('asmh_middle_menu_before', function() { return '<div style="float:right;">Content</div>'; });
This is tricky indeed, something is probably interfering in plugin’s css. Will look more and get back to you.
SteveFromAus is right, this is only *sticky* header, it doesn’t replace your header, it’s a free version. So, it appears only when you start scrolling and after the position you defined in settings.
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] JSON response for scheduled postsYes that’s what I thought of course, it was more rhetorical ??
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] JSON response for scheduled postsGreat thanks, that was right direction.
I ended up with:
function my_give_permissions( $allcaps, $cap, $args ) { // check parameters here... $allcaps[$cap[0]] = true; return $allcaps; }
add_filter( 'user_has_cap', 'my_give_permissions', 0, 3 );
Here https://core.trac.www.ads-software.com/browser/tags/4.3.1/src/wp-includes/capabilities.php#L1066 it just checks whether $capabilities is empty or not, so that’s workaround.
All it needs is checking request parameters…
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Raw contentresolved
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Raw contentUsed
rest_prepare_post
filterAnd then in callback…
public static function rest_prepare($data, $post, $request) { $data->data['content']['raw'] = $post->post_content; return $data; }
Forum: Plugins
In reply to: [WP REST API (WP API)] Action rest_api_init doesn't exist?Ah there is another plugin: https://www.ads-software.com/plugins/rest-api/
That’s the one needed ??For font family you can put in Custom CSS tab like:
“.asmh-header {font-family: fantasy;}”
Colors are there as options, you should see them clearly ??
For keeping the body from scrolling above header you should lower you z-index css value for body element or some other site wrapper element, since sticky header has z-index=99, but it can be really any value, you could put it also in Custom CSS tab as much as you like.
Ok always glad to be helpful! ??
Forum: Plugins
In reply to: [Awesome Sticky Header by DevCanyon] Hide menu on mobile and leaderboard ADTo add anything you can use hooks. Look at sections “Filters” on plugins page: https://www.ads-software.com/plugins/awesome-sticky-header/
You can use it like this:
add_filter('asmh_middle_menu_before', function() { return '<div style="margin:20px;float:left;">test</div>'; });
This hook allows you to add any content before main menu, which could be very helpful.
Forum: Plugins
In reply to: [Awesome Sticky Header by DevCanyon] Hide menu on mobile and leaderboard ADHi,
The “Hide menu if narrower than” setting simply means as it says – to hide *MENU* (not to disable the whole sticky header completely) on screen size smaller than provided, so it shows hamburger icon then instead of the menu.
However, I added option to version 1.0.3, it’s called: “Hide header if screen narrower than”. If you update the plugin you’ll have it.