Ashish Kumar (Ashfame)
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Admins can’t see user posts but non-admins canYes, disabling plugins to find the culprit on a staging is a good way to go about it. Good luck!
Forum: Fixing WordPress
In reply to: Admins can’t see user posts but non-admins canSince this is happening for only admin users, and I can see its loaded via ajax call: Does the HTTP request is still fired when an admin user loads the page? Check the network tab in browser for that.
If not, then is there a JavaScript error on the page (check browser console). Or perhaps the JavaScript file is not even loaded for admins that handles this loading of activity feed?
I don’t know BuddyPress much but could also be a condition in the code which handles this? Look for
current_user_can()
in there.Forum: Fixing WordPress
In reply to: Posts stopped showing on Category PagesThere is some PHP fatal error that’s happening which halts the HTML output on category pages. If you check your PHP logs in your hosting panel, you would find what’s causing it. Then it would be a matter of addressing that.
You can also try the approach of deactivating all plugins to see, what’s causing it. I know you said you tried that, but its important to be logged in when you try that, so that you don’t accidentally view a cached page (caching plugins usually don’t cache pages for logged in users).
Feel free to come back here with that error message you find for the category pages and I can help further.
Forum: Fixing WordPress
In reply to: Rich Text Editor (tinymce) triggering password protection loginWhen you did it for
admin-ajax.php
you must have done it in a.htaccess
underwp-admin
directory, since that’s where that file resides and just specifying the file name indicates a relative path to where that.htaccess
file is.To do it from WordPress root, you would do it like:
<Files wp-admin/admin-ajax.php>
So for tinymce, since it exists under
wp-includes/js/tinymce
, you would have to specify the path like the following in.htaccess
at the root of your WordPress install, to specify the rule correctly:<Files wp-includes/js/tinymce>
Or just do it how you were doing it, by putting that in a
.htaccess
file underwp-includes/js/tinymce
.But its better to have all the rules at root and not spread everywhere.
Forum: Fixing WordPress
In reply to: Election PluginHi, You would have to do some work to find the plugin suitable to your needs. You mentioned “your requirements”, without stating what they actually are. To me, it seems like running a poll is equivalent to running an election. Poll options are candidates. Many plugins to run poll would offer some or the other way of limiting duplicate votes, by either forcing only logged in users to be able to vote or by limiting votes by IP address.
Your best bet would be to find plugins free or paid, try them out and see what fits your use case.
Forum: Fixing WordPress
In reply to: Add new – plugin or theme – resolve to error 404Sounds like
plugin-install.php
is missing from your WordPress installation. This is why trying to access that URL, gets defaulted toindex.php
& then the theme renders a 404 page on it.I would suggest you to overwrite your WordPress files from a freshly downloaded file of the existing version that you are on. You can also ask your webhost to do it for you.
You can find the right zip file for your release here – https://www.ads-software.com/download/releases/
Forum: Fixing WordPress
In reply to: some times some images redirecting url to ip addressHi, Please provide more explanation as to what the issue is. On the website that you have linked, all images seem to be loading just fine.
Its not entirely clear what is your usecase. Sounds like you want an admin to verify and approve an ad before it goes live on your website. But are these user submissions or non-admin users?
Either way, you would need to find a WordPress plugin that lets you manage your ads and offer the functionality that you are looking for. Here is a link to the search results for “ads” on plugins repo – https://www.ads-software.com/plugins/search/ads/
Forum: Fixing WordPress
In reply to: Receiving JSON error when trying to upload imagesSounds like your JSON response have some additional output from PHP notices/warnings/errors.
On production site, its not recommended to have warnings/errors show up in output, so see if in your wp-config.php you have any of the two constants as true:
define( 'WP_DEBUG', false ); define( 'WP_DEBUG_DISPLAY', false );
Change them to
false
if they are true and see if that fixes it?To fix the root cause: You would be able to look at what that is, if you inspect the response to that particular HTTP call in your browser. You can also check your PHP logs for the same.
After identifying the cause of that additional output, you can fix it and upload would start working correctly.
Forum: Everything else WordPress
In reply to: Redirect multilingual web page while contains utm_sourceThis (untested) would probably work:
RewriteEngine On RewriteCond %{QUERY_STRING} ^utm_source [NC] RewriteRule ^(.*)/$ /$1? [L,R=301]
However, I would like to point out that you probably doesn’t need to redirect these URLs at all, as long as you have canonical URLs being set on your pages, that look like in your page’s HTML source:
<link rel="canonical" />
There are several ads manager plugin that you can try from plugins repo. I found this one that seems to be popular.
- This reply was modified 1 year, 9 months ago by Ashish Kumar (Ashfame).
Forum: Fixing WordPress
In reply to: WP + WooCommerce not workingHi, It seems like the website just doesn’t have any content on it. What error message do you see when you try to add content (like adding project as you mentioned)?
Would be good to follow instructions provided by Divi theme as well to see if you are just missing an initial import of “dummy content”. And if its a Divi theme specific error, reaching out to their support would also be a wise choice.
You can also check report of “Site Health” under Tools – https://www.ingeborganderssonart.se/wp-admin/site-health.php
Don’t think there is a need to reinstall WordPress but you can try considering the site is empty? If there are any missing files, that would fix it.
This shouldn’t affect other websites running on your webhosting account, but if you are unsure of the options in your hosting panel, best to ask your webhost for instructions. And always a good idea to take backups, in case anything goes wrong, so that its possible to restore a previous version of the website.
Forum: Fixing WordPress
In reply to: how to maintain custom post type data for 3 websites?Yeah, I don’t think that can be done easily. setup_postdata() is a function that can be used to setup global state with the data you have pulled, but that has little benefits, as you will still have to source all the data yourself, which is what you seem to be struggling with.
The easiest route I think is to just pull all the data with a SQL query like I showed you earlier and then just work with that data. You will need multiple sql queries for fetching their postmeta values as well. Really a play of SQL queries.
Considering that you are now connected to a different database and are able to make queries, you essentially can access all the data directly, the hardest part is done.
Forum: Fixing WordPress
In reply to: how to maintain custom post type data for 3 websites?So when you call a function get_field(), you don’t need to tell it which post, right? That’s because it knows which post you meant because of state/context/global variables.
So now when you are working with raw data, all things that were being done for you, you would have to do it yourself. So that would mean making use of get_post_meta() https://developer.www.ads-software.com/reference/functions/get_post_meta/ and passing post ID yourself and similarly with other functions.
Also filters that were applied on values on any such functions won’t work, as you are simply connecting to its database and not processing the code on the website you are connecting to.
If this starts becoming too much, you could also explore utilizing REST API to get the data out. https://developer.www.ads-software.com/rest-api/
Forum: Fixing WordPress
In reply to: how to maintain custom post type data for 3 websites?get_results()
expects SQL query and not an array of arguments, check – https://developer.www.ads-software.com/reference/classes/wpdb/get_results/So, if you just construct the SQL query yourself and supply that to get_results() it will actually get you the data as long as query is right. Try
var_dump( $variablename );
to see how the data looks like in it.Functions like
have_posts()
,the_post()
etc work on the basis of a global state/context stored as per the main query, which is used while figuring out what content do we need to show on this request – it figures out the context, set certain global variables & then these functions make use of the value of such global variables (state/context).For example this piece of code connects to a different database and pulls out the list of tables by running a query:
define('XDB_NAME', 'dbname'); define('XDB_USER', 'user'); define('XDB_PASSWORD', 'password'); define('XDB_HOST', 'localhost'); $wpdb2 = new wpdb( XDB_USER, XDB_PASSWORD, XDB_NAME, XDB_HOST ); $query = "show tables"; print_r( $wpdb2->get_results( $query ) );
Hope that helps.