Aashish S
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Author not displaying in BlogHi @jldouglas58
I assume you need to display somewhere near a yellow-colored date.
Following is a code snippet using which you can print the author of the current post;
<?php
$author = get_the_author();echo $author;
I hope this is what you are looking for. Or else try to explain your requirement in detail, then I can help you out more on this.
Thanks,
AashishForum: Fixing WordPress
In reply to: /login and /admin stopped workingHi @djav1985
The issue of redirection can be because of the redirection mechanism not working at server level.
In order to address the issue, it is suggested to check if the mod_rewrite module if available (if your webserver is Apache2). Similarly, if your web server is NGiNx, then check appropriate routing rules are included in the .conf file.
Kindly review either of the configurations and see if the issue is fixed.
Thanks,
AashishForum: Developing with WordPress
In reply to: Retrieving Current Post Title to FooterHi @hennyyang
In order to retrieve and print post title in the footer, you can either use any one of the snippet code
<?php echo get_the_title($post->ID); ?>`
OR
<?php the_title(); ?>The code snippets are pretty self-explanatory, the only significant thing we have used is the global variable ‘$post’, it stores current active post object and thus allows us to retrieve various post related attributes such as Post ID, Post Name, etc.
I hope you now have a solution to your query… Good Luck…
Happy Programming 🙂
Regards,
Aashish- This reply was modified 6 years, 6 months ago by Aashish S. Reason: Remove, argument from the_post() method, as it was printing post id
Hi @nixiack8 (Mike)
Thank you for your inputs. I will review the plugin further if required.Regards.
Forum: Fixing WordPress
In reply to: The problem with redirection from HTTP to HTTPSIt seems the site is working fine when we use https instead of HTTP.
I.e https://program-ace.com/contact-us/ link works fine if it is accessed using https and does not work if accessed using HTTP.
This means at your server PHP 7 is working for SSL port i.e 443 only & not for port 80 (HTTP port).
So I request you to check this at the server level and either configure PHP 7 for HTTP port as well. Or in WordPress do force SSL, so that each time your site runs as SSL only.
However, if in case you require to do any server-level modifications do consult with server team once.
Hope you get some head start with the above explanation.
Thanks.
Forum: Fixing WordPress
In reply to: Auto Update of WordPress doesn’t workHi @doffine
Glad that the code snippet shared worked for you.
Yes as per WordPress architecture Cron execution is done only when any page of the site is accessed. Thus an auto-update functionality required a bit more alteration.
Happy Programming 🙂
Regards.
Forum: Fixing WordPress
In reply to: Auto Update of WordPress doesn’t workHi @doffine
The problem you are facing during an auto-update will probably be due to cron execution issue.
WordPress crons do get executed once page loads on a browser.
A solution to this is mentioned in following the link.
http://nickohrn.com/2014/07/quick-tip-wp-cron-http-basic-protected-site/Or try to set cronjob explicitly at server level if you have access to server control panels such as CPanel or Plesk. Or else ask server team to address this for you.
Hope this piece of information helps, all the best!
Regards.
Forum: Developing with WordPress
In reply to: esc_attr() on hard coded stringesc_attr() method is one of data sanitization method included in WordPress Core library of methods.
And it serves following purpose-
* Filters a string cleaned and escaped for output in an HTML attribute.
* Text passed to esc_attr() is stripped of invalid or special characters before output.I just thought of mentioning the above explaination to clear the purpose of usage of the method.
Now to clarify your query:
a. esc_attr() is used within “for” attribute of the label tag, because the value being retrieved here uisng snippet “$this->get_field_id( ‘title’ )” is a dynamic value and not static, which means there are chances of special characters been added by administrators in a title field. So our data validation check will eliminate those characters and print clean output on broswer.b. Now observe “esc_attr_e( ‘Title:’, ‘text_domain’ )” snippet. Here esc_attr_e() method is used and not esc_attr(). The purpose of this method is to escape the string from special charaters & translate it to respective language domain whichever is active or default in the application. Again translations will be dynamically fetched from system if it is site uses language other than english.
—
I believe now many of your doubts pertaining to esc_attr() method clear now. And it is always recommended to using data sanitization methods whereever applicable.Happy Programming 🙂
Regards.
Forum: Developing with WordPress
In reply to: Rename API route item@bcworkz yes you are correct my thought was similar to what you have stated. We cannot rename core parameters in a build-in API endpoint.
Thank you for sharing your inputs.
Forum: Developing with WordPress
In reply to: Rename API route itemHi @diplatis
If I understand your query correctly probably, you are looking for adding/registering a custom endpoint for an API in your application.
In order to define custom endpoints, write a plugin method and attach it with action hook ‘rest_api_init’.
Hope this helps to sort out your query. All the best! Happy Programming!Regards.
Forum: Fixing WordPress
In reply to: Looking for filter pluginHi @shaytorn
I would suggest you check Lava Ajax Search. Check if this extension suffices your requirements.
https://wordpress.org/plugins/lava-ajax-search/Thanks,
AashishForum: Fixing WordPress
In reply to: Add plugin search doesnt workWell, a simple test to check admin-ajax whether working or not is by checking search functionality on other sections such as Pages or Posts.
If it works then the problem would be specific to Plugins page due to some of the other conflicts or edits in core files.
Or else if it does not work then you will have to enable debug mode to true, trace error contents through log file determine the cause of the issue.Forum: Fixing WordPress
In reply to: Server is down, can’t log in at allHi @katetabbott
Yes for sure as a first & foremost thing, please connect with the server team to help you out to sort out the issue you are facing.
Also, while the server team is debugging your issue, check whether if you can access the site using http://yoursitename.com (try accessing this link on a different browser or incognito mode of your browser).If it works, then the issue is specific to force SSL, in that case just rename the force SSL extension located in “wp-content/plugins” folder if possible.
And see if the site works. Make sure you have a proper understanding of the activities you are doing & have proper backups with you.Else if http://yoursitename.com is not working then await for inputs from server team.
Thank You,
AashishForum: Fixing WordPress
In reply to: Page cannot be reached errorHi,
http://twinfallsumc.org/ this link is rendering properly at my end.
I think the issue is sorted now, if not try clearing browser cookies & cache & check whether if the issue is not sorted at your end as well.
Or else please let know in case you have any further issues or so.Thanks,
AashishForum: Fixing WordPress
In reply to: Add plugin search doesnt workIn that case could you please check if admin-ajax is functioning properly or not.
Try disabling any third party extension if possible & check if it is caused by any extension or so.