christopher.amirian
Forum Replies Created
-
Forum: WordPress Mobile App
In reply to: App doesn’t show any picture in the pagesI’m glad that it worked for you ??
Forum: Fixing WordPress
In reply to: Blog site login always redirect to main site loginPerfect! Thank you for sharing ??
Forum: Fixing WordPress
In reply to: Blog site login always redirect to main site loginHi there,
It looks like there might be a redirection issue or a misconfiguration causing the login page of the blog site to redirect to the main site’s login page. Here are a few steps you can try to resolve the issue:
- Check .htaccess file: Sometimes, redirection issues can be caused by rules in the .htaccess file. Check the .htaccess file in the root directory as well as in the /blogs/ subdirectory to see if there are any redirection rules that may be causing this issue.
- Check Plugins: If you are using any security plugins or redirection plugins, they might be causing the issue. Temporarily deactivate all plugins by renaming the plugins folder to something else (e.g.,
plugins_old
) via FTP or File Manager in your hosting control panel and see if that resolves the issue. If it does, you can reactivate plugins one by one to find out which one is causing the problem. - Check wp-config.php: Make sure that the
WP_SITEURL
andWP_HOME
variables are correctly set in thewp-config.php
file for your blog instance. It should look something like this for the code:define('WP_HOME','https://www.datanumen.com/blogs'); define('WP_SITEURL','https://www.datanumen.com/blogs');
- Clear Cache: Clear your browser cache and cookies. Sometimes browsers cache the redirection and it can cause unexpected behavior.
- Manually Access the Login Page: Try accessing the login page directly by typing in the full URL: https://www.datanumen.com/blogs/wp-login.php
- Check Server Configuration: If your server is running on Nginx, check the configuration file for any redirection rules. If you are on a shared hosting, contact your hosting provider for assistance.
These are the possible causes that I could think of.
Best regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: Track User ActivityHi there,
For this purpose, you might want to consider using specialized tools that not only offer tracking features but also help in understanding user behavior. Here are some options:
- Hotjar: Hotjar is a powerful tool that allows you to visually represent user interactions with heatmaps. It also allows you to record user sessions so you can see exactly how users are interacting with your website.
- Mixpanel: Mixpanel enables you to track user interactions with your website in real-time. It offers features like event tracking, user analytics, and profiles, which allow you to understand how individual users are engaging with your content.
- Crazy Egg: Like Hotjar, Crazy Egg provides heatmaps and user recordings but also offers robust A/B testing features. This is useful for understanding which elements of your site are engaging your users the most.
- Heap: Heap automatically captures every web, mobile, and cloud interaction such as clicks, submits, transactions, emails, and more. It allows you to analyze data to get the answers you need.
These tools can be integrated into WordPress and configured to track user interactions at a granular level, such as which buttons are being clicked, which pages are being viewed, etc.
To make sure I am clear, collecting detailed user data might have privacy implications, and you should ensure that you comply with relevant data protection regulations. It’s important to have a clear privacy policy and, where necessary, obtain consent from your users for data tracking.
Best regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: remove url from postHi there,
The best way to get answer for new questions is to open up another forum thread as the threads are meant to handle one question for the sake of clarity and ease of use.
Thank you for your understanding.
Best regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: remove url from postHi there,
You can change the code to apply an HTML class to the image:
function replace_image_url_with_tag($content) { if (in_category('arti-visive')) { // Replace 'your-category-slug' with your specific category slug $pattern = '/<p>(https?:\/\/[^<]*\/([^<]*\.(?:jpg|jpeg|png|gif)))/i'; $replacement = '<p><img class="post-featured-img" src="$1" alt="$2"></p>'; $content = preg_replace($pattern, $replacement, $content); } return $content; } add_filter('the_content', 'replace_image_url_with_tag');
Then you can add CSS code to the style.css file of your theme to apply sizing and other styling:
.post-featured-img { max-width: 100%; width: 300px; }
For example, the code above forces the size of the image to be 300 pixels.
Best regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: remove url from postHi there,
The new URL that you shared has the image link embedded in aa P tag alongside other content inside that P tag. That is why you need to change the code to:
function replace_image_url_with_tag($content) { if (in_category('arti-visive')) { // Replace 'your-category-slug' with your specific category slug $pattern = '/<p>(https?:\/\/[^<]*\/([^<]*\.(?:jpg|jpeg|png|gif)))/i'; $replacement = '<p><img src="$1" alt="$2"></p>'; $content = preg_replace($pattern, $replacement, $content); } return $content; } add_filter('the_content', 'replace_image_url_with_tag');
Best regards,
Christopher Amirian
Forum: Fixing WordPress
In reply to: Images on the homepage show very lateHi there,
Upon checking my browser console I see that there are images that are not loaded correctly and they throw the 404 (not found) error.
Here is the list of them:
https://mnins.com/wp-content/themes/wp-state-insurance/images/banner/box-bg.png
https://mnins.com/wp-content/themes/wp-state-insurance/images/banner/box-1.png
https://mnins.com/wp-content/themes/wp-state-insurance/images/banner/box-2.png
https://mnins.com/wp-content/themes/wp-state-insurance/images/banner/box-3.png
https://mnins.com/wp-content/themes/wp-state-insurance/images/banner/box-4.png
All of them seems to be loaded from your theme but the URL is wrong.
Check your theme code to find the problem about those.
One other point is that I see you have a script below on your website:
<script type="text/javascript"> jQuery(document).ready( function($){ $('.wpcf7-text, .wpcf7-textarea').click(function(){$(this).val(''); }); } ); </script>
The code above throws the error below:
(index):806 Uncaught ReferenceError: jQuery is not defined
I suggest that you change the code to:
<script type="text/javascript"> jQuery(document).ready( function($){ $('.wpcf7-text, .wpcf7-textarea').click(function(){$(this).val(''); }); } ); </script>
Best regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: Strange URL’s with tb parameter, should I be worriedHi there,
It appears that your website is being hit by some form of automated traffic. This could be someone trying to probe your website for vulnerabilities, or it might be a bot/script that is not properly configured and hitting your site unintentionally. Here are some steps you can take to mitigate the issue and protect your site:
- Analyze Traffic: Determine if this traffic is coming from a specific IP range or set of IPs. This will help you understand if it’s targeted or random.
- Block Unwanted Traffic: If you identify that this traffic is coming from a specific range of IPs or it’s definitely malicious, you can block those IPs at the server level. This will prevent those IPs from accessing your site.
- Robots.txt: While malicious bots usually do not respect the rules in a robots.txt file, legitimate crawlers do. Adding disallow rules might prevent well-behaving bots from crawling unnecessary URLs.
- Implement CAPTCHA: If you suspect the traffic is trying to exploit a specific form or functionality on your site, you can implement CAPTCHA to that section of your site. This would stop automated scripts from abusing it.
- Rate Limiting: Implementing rate limiting on your server will help mitigate the effect of any bots or scripts that are sending high amounts of traffic to your site in a short period.
- Monitor Server Resources: Keep an eye on your server’s resource usage. If these requests are using up too many resources, it could slow down your site or make it unresponsive.
- Consult Hosting Provider or Web Application Firewall (WAF): If you are using a hosting service, inform them about the suspicious activity. They may have tools to help you mitigate the issue. Additionally, using a Web Application Firewall can help protect your site from various types of attacks.
- Check for Vulnerabilities: Ensure your website and its components are updated, and check if there are any known vulnerabilities that might be exploited through the query parameters.
Finally, I would move my website behind CloudFlare protection. Click here for more information.
Best regards,
Christopher Amirian
Forum: Developing with WordPress
In reply to: How to Add span tag to text in wordpress?Hi there,
Thank you for providing the feedback. It seems like the attribute
data-no-translation
is not getting added properly.One possible solution is to utilize the
apply
function to customize how the formatting gets applied. We can extend theMyCustomButton
component to include the attributes when the format is applied.Here is an updated version of the code:
( function( wp ) { var MyCustomButton = function( props ) { return wp.element.createElement( wp.blockEditor.RichTextToolbarButton, { icon: 'editor-code', title: 'No Translate', onClick: function() { props.onChange( wp.richText.toggleFormat( props.value, { type: 'my-plugin/my-custom-button' } )); }, isActive: props.isActive, } ); }; var withAttributes = { attributes: { 'data-no-translation': 'value' }, apply: function( value, { isActive } ) { var newValue = wp.richText.toggleFormat(value, { type: 'my-plugin/my-custom-button' }); newValue.formats = newValue.formats.map( ( formats, i ) => { return formats.map( format => { if ( format && format.type === 'my-plugin/my-custom-button' ) { format.attributes = { 'data-no-translation': '' }; } return format; } ); } ); return newValue; } }; wp.richText.registerFormatType( 'my-plugin/my-custom-button', { title: 'No Translate', tagName: 'span', className: null, attributes: { 'data-no-translation': 'value' }, edit: MyCustomButton, ...withAttributes } ); } )( window.wp );
This updated code adds an
apply
function that will map through the formats and add thedata-no-translation
attribute to thespan
tag.I did not test that myself on my installation so I’d appreciate it if you could check and see if it works.
Bets regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: remove url from postHi there,
If you used my previous code you should replace it with the new code that I suggested, if you did not add the previous code you do not need to replace it with anything, you can just add the code in functions.php.
Best regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: remove url from postHi there,
Yes it is possible by replacing the code in functions.php file of your theme with this one:
function replace_image_url_with_tag($content) { if (in_category('your-category-slug')) { // Replace 'your-category-slug' with your specific category slug $pattern = '/<p>(https?:\/\/[^<]*\/([^<]*\.(?:jpg|jpeg|png|gif)))<\/p>/i'; $replacement = '<p><img src="$1" alt="$2"></p>'; $content = preg_replace($pattern, $replacement, $content); } return $content; } add_filter('the_content', 'replace_image_url_with_tag');
In this modified code, the regular expression pattern captures the URL and the normalized name of the image file (without the extension) using the parentheses
( )
within the pattern. The captured values are then used in the replacement string.The
$1
in the replacement string represents the captured URL from the regular expression pattern, and the$2
represents the captured normalized name (without the extension) of the image.Make sure to replace
'your-category-slug'
with the actual slug of your specific category.With this modification, the code will add the
<img>
tag inside the<p>
tag and set the normalized name of the image as thealt
attribute of the<img>
tag.Remember to add this updated code to your theme’s
functions.php
file or in a custom plugin file.Best regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: Document Management InquiryHi there,
When it comes to document management within WordPress, there are a few options you can explore. While no single plugin may meet all of your requirements out-of-the-box, you can combine multiple plugins to achieve the functionality you need. Here are some suggestions:
- Document Management Plugins:
- WP Document Revisions: This plugin provides basic document management features like version control, document collaboration, and file organization.
- SeedDMS: It’s an open-source document management system that can be integrated with WordPress. It offers advanced features like version control, access control, and workflow management.
- Document Manager: This plugin allows you to organize and display documents in a hierarchical structure. It includes features such as version control and document preview.
- Integration with Office Tools:
- CollabPress: This project management plugin has integration with Google Docs, allowing you to collaborate on documents online. While it doesn’t directly integrate with MS Office or LibreOffice, it provides an alternative collaborative solution.
- Windows Integration:
- WordPress itself doesn’t provide direct integration with Windows. However, you can consider using cloud storage services like Dropbox, OneDrive, or Google Drive to store and manage your documents. These services have desktop applications that integrate with the Windows file system, providing seamless access to your documents.
- Customizable Validation Process:
- For customizable validation processes, you may need to develop custom functionality or seek the assistance of a developer. Plugins like Gravity Forms or Formidable Forms can be used to create custom forms for document validation. You can integrate email notifications and workflows to handle the validation process.
- Digital Signatures:
- Digital signature functionality may require a separate solution integrated with your document management system. Services like DocuSign or Adobe Sign can be used to add digital signature capabilities to your workflow.
Remember, it may be necessary to evaluate and test different combinations of plugins to meet all of your specific requirements. Additionally, consulting with a developer or development team could help you create a custom solution tailored to your company’s needs.
Please note that the availability and compatibility of plugins may vary, so it’s essential to check their documentation and reviews to ensure they meet your requirements and are compatible with your WordPress setup.
Best regards,
Christopher Amirian
Forum: Everything else WordPress
In reply to: remove url from postHi there,
I tested the code on my WordPress installation inside the functions.php of the theme and it did not give any errors.
Would you please be more specific on which errors you get so I can understand and help?
Best regards,
Christopher Amirian
Forum: Developing with WordPress
In reply to: Custom Post Single Template with Block ThemesHi there,
You’re right; blocks are self-contained units with their own templates and configurations. However, a plugin can still integrate seamlessly with a block theme by providing block patterns, block templates, and even custom blocks. Here’s how the user story might unfold and answer your questions:
- Custom Post Type: You can still create a custom post type for staff within your plugin. This custom post type can have its taxonomies, meta fields, and be queried separately from posts and pages.
- Custom Blocks: Within your plugin, you can create custom blocks that specifically handle staff data. For example, a block that displays a staff member’s profile, including their name, image, bio, etc.
- Block Templates: You can create block templates within your plugin for the staff custom post type. These templates are pre-designed layouts made up of blocks, and they can automatically apply when a user creates a new staff entry. This means that users don’t have to manually create pages or add blocks for staff; the block template can handle the layout.
- Adding Staff: When a user wants to add a new staff member, they would create a new entry in the staff custom post type. The block template you created for staff would automatically apply, and the user could fill in the necessary information using the custom blocks you’ve created for staff data.
- Query Staff & Archive: Since staff is its custom post type, you can create custom queries and archives specifically for staff. You can also create a custom block that queries and displays a list of staff members, which can be added to any page by the user.
- Staff-Specific Options: With custom post types and custom blocks, you can create specific options, taxonomies, and parent pages just for staff, without affecting other content types or requiring changes to the theme.
In this way, your plugin can offer a streamlined user experience for managing staff data, whether the user is using a classic theme or a block theme. The key is to create custom post types, custom blocks, and block templates within your plugin.
For further reading and examples, you can refer to the WordPress Block Editor Handbook.
Also this doc for the block templates that you can add in your plugin.
Best regards.
Christopher Amirian