martinhult
Forum Replies Created
-
How did you work it out??? I got the same problem
My site: https://www.alladessautgifter.com
Forum: Plugins
In reply to: [Twitter Embed] [Plugin: Twitter Embed] No tweet displayedI got the exact same problem, debug error:
Notice: Undefined property: stdClass::$html in /customers/_3/5/0/martinhult.com/httpd.www/wp-content/plugins/twitter-embed/twitter-embed.php on line 97
Turning the plugin on/off didn’t work neither did launching debug mode.
Forum: Fixing WordPress
In reply to: Is there a easy way to make the active navigation link change color?What I did was to use WordPress own codes on the matter:
https://codex.www.ads-software.com/Dynamic_Menu_Highlighting
In particular ‘Method Two: With CSS in One Document’. The guide didn’t really help me at first as I didn’t know how to bridge the gap between WordPress codex and my own meny.
The crux, as always, is in finding out and identifying your Site ID.
To see what your pages IDs are you do the following:
1.) Enter the admin mode through /wp-admin
2.) Go to Pages
3.) Hoved the Edit text and look down at the status bar of your browser. A number should be displayed in the site and the code should look something like this:https://www.martinhult.com/wp-admin/post.php?post=274&action=edit
The number you are looking for is the one after post= which in my case is ‘274’.
Going back to the code provided to us by WordPress in the codex it’ll look like this in the end:
<ul id="menu"> <!-- To show "current" on the home page --> <li<?php if (is_home()) { echo " id=\"current\""; }?>> <a href="<?php bloginfo('url') ?>">Home</a> </li> <!-- To show "current" on the About Page --> <li<?php if (is_page('<strong>About</strong>')) { echo " id=\"current\""; }?>> <a href="<?php bloginfo('url') ?>/about">About</a> </li> </ul>
You usually dont have to edit the is_home code as it will always bring you to the front page of the site (ie. index.php) which it considers home.
The one thing you NEED to edit however is the section in the code that I made bold. The text there should be replaced with whichever number you managed to come by in your wp-admin trip.
So MY version of the code would look something like:
<ul id="menu"> <!-- To show "current" on the home page --> <li<?php if (is_home()) { echo " id=\"current\""; }?>> <a href="<?php bloginfo('url') ?>">Home</a> </li> <!-- To show "current" on the About Page --> <li<?php if (is_page('<strong>471</strong>')) { echo " id=\"current\""; }?>> <a href="<?php bloginfo('url') ?>/about">About</a> <!-- Remember to change this part to the one you want it to display. You can call it whatever as well as the url is a valid link. --> </li> </ul>
And that’s it.
Just dont forget to add a
<style> #current { background-color: #336699; } </style>
before you finish coding.
Hope this will help someone struggling with adding dynamic navigation to their site.
Forum: Fixing WordPress
In reply to: My WordPress site loads really slow. Any ideas as to why?Works like a charm! Thanks a lot! The initial load is slow, of course, but after that it loads really fast.
Is there any other way to speed up the function call? ie. make it load after the rest of the page has loaded or something similar.
Forum: Fixing WordPress
In reply to: My WordPress site loads really slow. Any ideas as to why?The code surely made the loading of the site a lot quicker but it seems to have broken the code somehow. Now it says that all posts has 0 comments…
This is what the .txt file says:
{"http:\/\/www.martinhult.com\/archives\/572":{"id":"http:\/\/www.martinhult.com\/archives\/572","shares":4}}
Forum: Fixing WordPress
In reply to: My WordPress site loads really slow. Any ideas as to why?Anyone knows how I can cache the “fb_comment_count” function without using a plugin??
This is my fb code:
function fb_comment_count() { global $post; $url = get_permalink($post->ID); $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url); $json = json_decode($filecontent); $count = $json->$url->comments; if ($count == 0 || !isset($count)) { $count = 0; } echo $count; }
Forum: Fixing WordPress
In reply to: My WordPress site loads really slow. Any ideas as to why?What I’d like to do is to make the comments load AFTER I’ve loaded the entire site but I dunno how to do that…
Forum: Fixing WordPress
In reply to: My WordPress site loads really slow. Any ideas as to why?I found out why the page loads to slow. It’s because I’ve integrated Facebook comments into the feed. WordPress has to check all posts and their current comment count before the site loads.
I have no idea how to fix it though as it isn’t a plugin per se but rather hardcoded into the homepage.
Forum: Fixing WordPress
In reply to: My WordPress site loads really slow. Any ideas as to why?It’s the initial connection slowdown that I want to reduce, the rest doesn’t really matter much for me.
Forum: Fixing WordPress
In reply to: My WordPress site loads really slow. Any ideas as to why?I did a speedtest on two different homepages to give a bit of insight into what might cause the delay and neither Vimeo/Youtube seems to be the major culprits although I might be reading the data the wrong way:
https://www.webpagetest.org/result/120501_S8_464HB/1/details/
https://tools.pingdom.com/fpt/#!/lh2jFh4cn/https://www.martinhult.com/How do I do that?
Yes, I’m sorry I should have been more clear.
The UL/LI I’m looking to improve upon is the text on the right side of the site. Starting with “En nostalgisk ?terblick till midsommar p? M?ja”. It’s the “get_archives” under “div id=”menu-right””.
Thanks for taking your time and checking my code out!