Using a Wordpress plugin feature elsewhere within theme files - wordpress

I'm using the ultimate member online plugin, which shows members' online status.
When enabled to show on a user's UM profile page, it looks like this, for example:
When creating posts, it is common for data pertaining to the author to display somewhere within the post. For example:
What I'd like to accomplish is to have online status (shown in first image, above) also be displayed within this author data, shown within a post.
I've poked around in theme/plugin files, and I'm CLOSE!
I found where I need to edit, within the theme files (wp-content/themes/plum/inc/template-tags.php file)
I've narrowed the plugin files and content within them down, to what i believe would be the appropriate code to insert into theme files. Screenshots and copied [relevant] text can be found here:
Ive been playing around, reading the web, creating a post on the official wp forums (as well as searching within them), and this is the best I've got so far:
On the surface, it looks like the problem is solved. However, that user ("testAuthor1"), is offline (and the greenlight there in that very last imgur link displays the user as online).

Related

TCPDF when viewing in browser only displays one page

Hi I have developed a wordpress site and noticed that when I visit PDF using this link: https://peppyplates.brookstonesites.co.uk/wp-content/fancy_products_orders/pdfs/74089_2.pdf
you are only able to see one page. If I then go into my file system and download the PDF it contains 5 pages. All 5 pages are duplicates I doubt this is an issue but thought it was worth mentioning.
When I visit the above link I want it to show all 5 pages. I'm not sure what is causing this issue. TCPDF is clearly creating the PDF correctly since when I download it the content is correct.
Could this be a wordpress issue and if so is there a fix because I don't want to have to go through the file system to get the file I need.
I am using a plugin called Fancy Product Designer to create the PDF, I have slightly modified it to add the duplicate pages which has worked a treat if I download the PDF.
It was a wordpress caching issue. I myst have created the PDF before adding the code to duplicate the pages. I created a new order downloaded the PDF and it contains the duplicate pages.
NOTE TO SELF: always clear server cache if there is no reason for the issue ;)

Sharing buttons in academic theme not working on blog post

I am sure this issue has a relatively straightforward solution, but I am a general web development novice, new to blogdown specifically, and just created my first site.
Aside from this one issue, everything is working great. In fact, I generally love the functionality, but I am having trouble getting the sharing buttons on my blog post to function properly. The issue is that a reader can share the title of a blog, on say Twitter, but it does not generate a URL for the post.
The result is that you get a Tweet with nothing linked... which is not helpful.
Leading to this not very actionable Tweet:
Instead what I want is this:
Here is the specific page where it is a problem:
https://mgb-research.netlify.com/post/gaussian-process-imputation-models/
And here is my Git repo with the site files:
https://github.com/matgbar/main_site
I can see that the button is referencing post/gaussian-process-imputation-models/, but it is not including the equally important: https://mgb-research.netlify.com/ in front of the page info.
I have tried tinkering with certain settings, including relativeruls=false vs. true. Nothing seems to make a difference that I have done so far.
I had the same problem. Instead of adding it to each post. I found a related issue where Yihui Xie recommends setting the baseURL on the config.toml file and then build the site:
serve_site() is only for local preview. If you want to publish the site, you need to run blogdown::build_site() so that baseurl is actually written to all pages.
After a number of different approaches to this problem, I resolved it by adding the baseurl: to each page's header (see image below).
The page now renders full links using the sharing buttons.

Best way to track down dependencies? (Wordpress + Woocommerce)

I am wondering what the best ways are to track down dependencies (I think that is the best way to describe it) between several files. Here are the details.
Context: I am working on adding a plugin called WooCommerce Product Bundles to the online store that I am managing. The plugin takes several products and combines them onto one page with a short description for each product.
The Problem: When the plugin is pulling in the short description for each product it is also pulling in the contents of product-elements.php which has a "Find a Dealer" button inside of it. This big button is then repeated 4 times on the rendered page and looks terrible.
The Goal: Is to remove these buttons by removing the hook for "product-elements.php" from the plugin, since nothing in that file needs to be displayed on the rendered page.
However... I cannot for the life of me find any references to product-elements.php in the plugin files... which means it is probably referencing another product page template file, which is then referencing something else, which is then referencing "product-elements.php".
If you guys understand what I am saying here... what is the best way to trace the full path of these files so I can find the actual reference I am looking for (and kill it with fire)?
Additional details:
- product-elements.php is a file in my theme. It is a default Woocommerce file that has been copied over and modified (sort of like a child theme, but it is a child file).
- Something in the bundle plugin files is pulling product-elements.php into the rendered page, but it is not referenced directly.
- There has to be some middle step in between these directories where there is a trail of references, how do I find it?
- Tools I am using, OSX, Tower(GIT), Atom text editor

Wordpress and Cloudflare: how to update (cached?) images

I have my blog (wordpress) web site hosted at bluehost.com. A few months ago I decided to enable Cloudflare (through CPanel).
It's all working well (and I am seeing better overall performance etc) BUT I have a small issue I am dealing with.
I posted this blog some 10 days ago: http://it20.info/2016/01/why-docker-containers-and-docker-oss-docker-inc/
A few days later I had to change picture #2 (of 3) to tweak it a bit. The old picture says "Unikernel" in the red rectangle and the new picture (I uploaded) says "Unikernel/vm".
Note that inside the blog post I make an external reference to the picture (in the html code):
http://www.it20.info/misc/pictures/WhyDocker-ContainersAndDockerOSS-DockerInc2.jpg
If you point STRAIGHT to the picture you will see the new version (so I know I have updated it properly).
However the blog post still shows the old picture (as if Cloudflare is caching it indefinitely).
If in the blog post I right click on the image and do a "view image" (Firefox) it points to: http://i0.wp.com/www.it20.info/misc/pictures/WhyDocker-ContainersAndDockerOSS-DockerInc2.jpg?resize=640%2C392
(which shows the OLD image).
Funny enough if I remove the "?resize=640%2C392" it shows the proper picture.
I am trying to figure out a proper procedure to 1) write a blog post that refers to pictures as external links 2) possibly update said picture via an FTP upload and 3) have Cloudflare render the updated picture.
Thanks.
The root of your problem could be that query string after the image URL:
?resize=640%2C392
In CloudFlare, go to the caching settings and check if your current caching level is standard. If yes try changing to either no query string or ignore query string.
As far as a proper proceedure for future posts where images could change, as an alternative to purging all your site files in CloudFlare, or selectively purging just the image file in question, woudl it be feasible for you to simply change the name of the updated image file, or keep the same name but upload it to a different directory? And of course update the image src in your HTML as well.
Good luck

Site producing bad urls?

I'm using a custom Genesis child theme and lately I've been noticing that many false articles have been showing up on webmaster tools. They look something like this:
I haven't written these nor are they topics my site focuses on so I have no clue why they are showing up. So far, I've had to delete about a hundred of these. I read on a forum that this can be due to my theme generating bad urls but I'm not sure what that means nor do I know how to fix it. What can be causing this?
I believe that this problem is due to your website being hacked or Google is trying to Crawl or follow a link within your content that is not really a link.
This is what webmaster tool tells you about the problem:
In Crawl Errors, you might occasionally see 404 errors for URLs you don't believe exist on your own site or on the web. These unexpected URLs might be generated by Googlebot trying to follow links found in JavaScript, Flash files, or other embedded content.
To find out if your website has been hacked. First get this total = WordPress number of pages + number of post + number of categories + number of PDF or files + Images. Then do a google search using the following query (without the quotes) "site:yourdomain.com" if the result number is exaggerated greater than the calculated total then your website is definitely hacked.
If you believe that your website is not hacked try to find from where these links are being generated. Here is the trick: Go to the Web Master Tool report and click on one of those links, check the "Linked from" tab. There should be one or many possible pages listed from where these unexpected links are coming from.
Two possible Outcomes:
The page from where the link is found is from your own website: Go
to that page and open the source code, do a Ctrl+F search for that
link, if found check what section or content is generating this
problem.
The page from where the link is found is NOT from your own website:
In this case try to contact the owner of the other site and ask the
link to be removed, if not possible I highly recommend you to create
a 404 page within your WordPress installation with some useful
links. Google how to do this, there are plenty of resources.
Hope this helps

Resources