You mixed JavaScript code with css.
Going by the code you provided you would need to do this.
<?php if (!is_user_logged_in()) : ?>
<style>
.product-purchase-box{
display: none;
}
</style>
<script>
($ => {
$(".single-product-widget").text("Please Login/Register To Download");
})(jQuery);
</script>
<?php endif; ?>
Related Posts:
- Converting HTML Template to WordPress Theme
- Customize position of social icons in upme plugin [closed]
- How to get the value of input hidden html from text editor to custom page template?
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Add data-id attribute to child page links
- Multisite – Display different header content based on which site is accessed
- Save Option on Database
- HTML in PHP problem [closed]
- Add multiple HTML attributes to an Elementor button
- Get author full name
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- Where should I install a PHP library into WordPress so that code in a webpage can activate it?
- Integrating WordPress to my website, while keeping my own authentication system
- WordPress Customizer: How can you have multiple active callbacks on one control?
- Edit postmeta when user changes user role?
- Multiple pages on one with different HTML
- How to add default images into theme customizer image control?
- Add custom HTML to posts page
- WordPress Ajax Data problem
- Remove all nav menu classes ( but keep useful ones… )
- Minify HTML, CSS, JS with PHPWee?
- Add attribute / custom attribute to product in woocommerce
- How to only show page id as body class?
- Shortcode content output but not in correct place
- Displaying theme options in css
- How can I hide Home in my menu in a specific page?
- Hide wordpress field if data is empty in post!
- Only show search results with if current date is between two dates?
- database interactions using OOP
- Changing layout with wp_customise
- Extending the WP_Widget_Text class
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- filter default query to show just selected level of child pages in wordpress
- user_profile_update_errors hook not executing
- Input data from email form not going to JSON file
- Menu jumping when calling it via PHP
- Different post styles depending on category
- Modify custom field input data before creating a new post
- Show latest posts in a plain HTML website custom widget [closed]
- Hide HTML element (by class or ID) with PHP
- Change order of custom submenu link in WP Admin?
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- How to remove coupon dropdown feature
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Add html link in functions.php files of the theme
- How to create a field in customize and show that in header.php?
- PHP contact form not redirecting [closed]
- How to Schedule Cronjobs for start of every month and year
- Handling PHP/HTML inside the output of a shortcode function
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Menu Custom Data Attributes
- Illegal string offset error in wordpress theme options textarea
- Separate array output into a
- Need help removing […] after excerpt
- Initial offset of number of posts in home page on the posts page
- WordPressUser Submission Form
- Shortcode displaying at the top of the page [duplicate]
- is_user_logged_in returning nothing on custom page
- Customize field names in backend profile edit page through function.php [duplicate]
- how to add datas in taxonomy to post with wp_insert_post
- WordPress custom post type and taxonomy
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- Change permalink structure specific category
- Time Delay a URL Redirect for Specific Page
- Cascading dropdown select search based on Parent Page & Child Page
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- I need to display posts in subcategory beside posts in main category
- Background image no longer fits to screen now that project is in php files
- Adding HTML Code to Replace Text in PHP
- Fatal error login WordPress [duplicate]
- How do I know if the user is a customer?
- How to block specific user id in custom login form?
- I want to fusion the product columns in email table order
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- How to use wp_ajax_set_post_thumbnail?
- Passing a value from an input field to a php function in WordPress?
- Comparison operator != not working in field [closed]
- Custom woocommerce payment gateway – Form
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Problem with my Login Plugin
- How to return html as a string from php for WordPress
- Show subcategory name selected in specific category woocoommerce
- Unable to insert current username into custom table through html form
- Add custom attribute to product’s HTML to woocommerce cart page
- Splitting table data to pages with numbers
- Use custom get results query to show posts WordPress
- How can I show only if custom field has content [closed]
- echo variable containing html and the_permalink();
- nested divs, classes for a grid in loop [duplicate]
- featured post as div background
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- how to manipulate HTML parameters using PHP conditions
- Display wordpress post to static website in the footer
- Php echo into tag
- How to edit homepage in WordPress?
- WP_Query not returning results
- How make wp_nav() with my css?
- How do I link the side images?
- How to create a container in php then customise it in CSS
- Custom HTML/CSS Theme into WordPress – SEO considerations