OS detection to display different links on WordPress page - wordpress

I would like for my WordPress post link to refer people to different pages depending on the OS that they are using. For example to download Mac version of software if they are browsing from MacOS.
I saw a tutorial on how to add user OS in function.php file, but i have no idea how to implement function on a specific WP page.

Based on that tutorial you don't need to change page link. On same page you can do that. Like section/button for Mac/windows.
Here how you can do:
Step1: Add the code on your functions.php then you will see on your website under body tag have a specific class if you are form Mac then "osx" or if you are from windows then "windows"
Step2: add class on you Mac section called "osxsection" & for windows section "windowssection"
Step3: Now do the css like this:
// to view the section on Mac
.osx .osxsection {
display: block !important;
}
.osxsection {
display: none;
}
// to view the section on Windows
.windows .windowssection {
display: block !important;
}
.windowssection {
display: none;
}
you can present that CSS code some different way also.
Try that hope it will help you :)

Related

Restricting download buttons so only logged-in users can view the buttons

I am building a website (using Wordpress, Neve theme and Elementor Pro) with teaching resources for teachers, under the picture of each resource I want to place a download button with the URL link to download the resource, is it possible to make this download button with the link only accessible to logged-in users using Custom CSS or what would be the easiest way to do this?
In WordPress, you would probably have to use something like this:
.your-button {
display: none;
}
.logged-in .your-button {
display: block;
}
Please notice that the button is only visually hidden and could still be accessed via the dev tools.
It's not safe to use CSS, or anything on the frontend to hide the download button if it's important that for example students cannot get at the resources/answers.
In the backend you can add this where you are creating the button:
if ( is_user_logged_in() ) {
... the code outputting the download button and info ...
}

CSS styling specific category (change logo/title)

I have created an alias domain to my old blog https://londonim.co.il/ so it will handle on the cycling related content under the domain: https://cyclondon.co.uk
I have managed to change the logo to the new hompage by creating a static page (and redirecting any traffic from https://cyclondon.co.uk to it.)
I have used this CCS:
/*cycling */
.page-id-3811 .cutewp-logo-img-link {
content: url(https://londonim.co.il/logo_cycle.png);
}
My question is as followed:
when i try to give any post from "cycling" category the same logo, nothing seems to open.
this is the code that is not working:
.category-cycling .cutewp-logo-img-link {
content: url(https://londonim.co.il/logo_cycle.png);
}
And also a followup if you may:
no matter what I do, whether i used cyclondon.co.uk or londonim.co.il I am getting the same website title from the Wordpress definition. Is there a way to define a custom web title for a specific page, similarly like changing the logo?
Many many thanks!
Have you tried throwing an !important on the end -
.category-cycling .cutewp-logo-img-link {
content: url(https://londonim.co.il/logo_cycle.png)!important;
}

How do i remove gravatar completely from wordpress?

Hi I'm trying to to remove gravatar completely for my website. I've already disabled gravatar on the discussion page setting of wordpress. However, I'm using a paywall plugin which uses gravatar (called memberful) and its account popup always shows the profile avatar regardless if its disabled or not on the discussion page.
Example:
I think the profile-window is actually an iframe...
To here: https://dylogue.memberful.com/account/subscriptions
Do you have access to this endpoint, or is it created by a script? Changing the general CSS wont help you if you do not have access to inserting css into this endpoint.
The stylesheets are in weird places:
https://d1zgk03a9fsd43.cloudfront.net/assets/reach/style-4556bac86321e164130eb81bc9c1bd3e8ad4f00e3a7f1b803ef1e7e272baf184.css
https://d1zgk03a9fsd43.cloudfront.net/packs/member-bafbfb186fc0b252fb994416a369b793.css
I didn't see the link to create an account and test this, but does this CSS work?
.memberful-account-header img {
display: none;
}
.memberful-account-header hgroup * {
margin-left: 0 !important;
}

Wordpress Category Page (unclickable)

Recently I have been working on my WordPress blog website is French https://www.geekparfait.com/.
I am using FlatNews WordPress theme http://demo.sneeit.com/flatnews/
Everything was going pretty well. But now I am facing this issue on my categories pages https://www.geekparfait.com/category/ios/. Its like I am unable to click the posts on category pages. The same issue is on the category pages sidebar as well.
But on the homepage https://www.geekparfait.com/, everything is working fine. I am able to click and open the posts on the homepage.
Hope I can get some insight from you guys.
Thanks
The issue is with the sidebar and the position attribute of it. Please try out the below code in style.css or theme option panel custom css setion.
.category section.fn-primary > strong {
position: inherit;
}
Hope this will work for you.
Screenshot
The problem is the sidebar is generating that can click in that entire div, try changing that position: relative. with
.category strong {
position: inherit!important;
}

How to change default wordpress logout template?

I am new to wordpress development and now I am stuck.
I need to change style and add some buttons in default wordpress logout template (when i am redirected to http://example.com/wp-login.php?action=logout ).
But the question is where i can find that template?
Thanks in advance.
Regards.
Ivelin Georgiev
Right...
There (unfortunately) isn't a template page for the login page. I'm not sure why this is, maybe its for security or something, I dunno. In any case you can't edit it directly without messing with the wordpress core.
However there are various hooks and actions you can add to in order to do some customisations. Here is some sample code from my own applications:
// this adds stuff to the head. You can add a stylesheet
// if you want, or just css like I have.
add_action("login_head", "cust_login_head");
function cust_login_head()
{
// this just changes the logo
?>
<style>
body.login #login h1 a {
background: url('<?=plugins_url('images/logomed.png',__FILE__)?>') no-repeat scroll center top transparent;
height: 64px;
width: 307px;
margin-left: 10px;
}
</style>
<?php
}
// these change the default links from wordpress to whatever you want
add_filter('login_headertitle', create_function(false, "return 'http://website.com';"));
add_filter('login_headerurl', create_function(false, "return 'http://website.com';"));
Stick that into your functions.php file in your theme to get it to work.
There will be other such methods and hooks you can change and add to, you just need to find them.
Use Themed login plugin - It allows to make login and registration process themeable using site's theme.

Resources