tferral
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Date Posting TwiceHave you a program with which you can look at and edit one of the files in the theme?
I think I found the spot where the date line is created when viewing an index page.
It is in the file: wp-content/themes/massage-clean/inc/template-tags.php on line 42. It looks like this:
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>;<time class="updated" datetime="%3$s">%4$s</time>';Change it to:
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time> <time class="updated" datetime="%3$s">%4$s</time>';The change is to insert after the first “</time>”
&npsp is a way of coding in space so that it does not get removed as simple spaces can be in some situations.
Save the file and go look at your index page. There sould be a space between the dates.
Let me know what you see.
- This reply was modified 7 years, 1 month ago by tferral. Reason: removed duplicate text at bottom of reply
Forum: Fixing WordPress
In reply to: Date Posting TwiceI just installed the Massage Clean theme and I’m seeing dates like this:
March 18, 2019March 21, 2019That first date is the date the post was published and the second date is when it was last updated.
Are you seeing the same thing – two dates run together?
Here’s what the source shows for the time fields:
<time class="entry-date published" datetime="2019-03-18T01:24:05-05:00">March 18, 2019</time><time class="updated" datetime="2019-03-21T23:53:55-05:00">March 21, 2019</time>Note the class names, the first is entry-date published’. The second is just “updated”.
On my system, the dates are date published and date updated.
Pull up one of your pages. Highlight just one of the date lines. Right click on the highlighted text and select View Source.
Copy what you see and paste it into a reply. Let me see what is there.
Forum: Fixing WordPress
In reply to: Date Posting TwicePerhaps it is showing the date the post was first published and also the date the post was last updated.
Are the dates identical?
Is the time showing along with the date? Is the date and time the same or different?
Thanks for the replies.
I’m going to close this resolved –
Post classes are dynamically created and some conditions apply as to when class sticky is included.
use is_sticky() to see if a post is a sticky.
Forum: Fixing WordPress
In reply to: Collecting social reviewsScrapping is a copyright violation – don’t do it. It is illegal and unethical to take others material and put it on your web site unless you get their permission and then clearly indicate exactly where the information from.
Forum: Fixing WordPress
In reply to: Date Posting TwiceFirst – that link your provided is to the localhost on your computer. No one can open your site when you have it installed locally on your computer.
What changes have you made lately, before the date display problem.
I need a lot more information before I can even begin to help your.
- WP release number
- Theme name
- what changes have been made before the problem began
- everything you can tell me about the site
Forum: Fixing WordPress
In reply to: 404 the page not foundIf we knew all of the changes you made maybe we could help you.
Tell us everything you did when you “tried making changes on my site”
Without knowing what changes you made or tried to make, we can’t provide you with much help.
So, in as much detail as possible, tell us what you changed on the site just before it quit working.
Forum: Fixing WordPress
In reply to: Fatal error: Uncaught Error: Class ‘WP_Post_Type’ not found inTip – when writing a message, press Enter twice, not just once, to insert blank lines between thoughts or paragraphs. White space (blank lines and spaces) make things much easier to read. Some forums will submit the message when you press Enter but not the forums here on WP.
——————
EDIT*****
I’m adding this after I submitted the reply –You said you created a .htaccess in the root. You will probably have to delete it before attempting the steps I give you, below. But, instead of deleting it, rename it to something like old.htaccess.
*************** END EDITI as able to use Google Translate to look at the page where you go the instructions.
Which method did you try to “move” WP to the root” – that page give you two ways?
Transfer (without moving) WordPress from a sub-folder to the main folder
or
Move WordPress from a subfolder to the root folder (physically)
I’m guessing you used the first method because of your description of what you did.
Unfortunately, without experience with FTP and MYAdmin, the steps they give you are fraught with danger. If you don’t understand each step, you can find yourself in trouble, as you are right now.
They tell you how to do the steps but they don’t fully explain what you are doing and, more importantly, why you are doing it. That leads to problems.
You said:
When I say that I removed the site file from the builder I mean that I went to FileZilla, clicked on the root (www.example.com) to open it, selected all the directories (.htaccess, softaculous and cgi-bin) except the wp one and deleted them.
I see the instructions saying:
## Delete all files and folders
Delete all WordPress files and folders in the main folder including the database, paying attention only to not delete the sub-folder where you are developing the new website (in this example the wordpress folder).
Perhaps the translation is bad but what I’m seeing talks about deleting an “old” WP installation, if there is one, in the “main” folder (let’s stick to calling the “main” folder, the root folder or root directory or just the root.
Those instructions don’t say to delete everything in the root, they say to delete ANY old WP installation in the root.
Did you have a WP installation in the root directory when you began this entire procedure? I’m guessing that you didn’t.
You deleted everything in the root directory except the subdirectory where WP was installed – correct?
That really screwed things up.
Do you have a backup of what was in the root directory, besides the subdiretory where WP was installed?
If not, can you remember some of the files and directories?
————————-
Okay, let’s do this:You will be making a backup of everything on the server, downloading latest version of WP, install it in the root directory and give it the name and password of the existing database. That should put you back in operation and then you can change settings, install any plugins, and get the site working and looking like it originally did in the subdirectory.
1) Use Filezilla to copy everything in the server root to a new directory on your computer – say c:\wpbackup Download everthing in the root to the new directory – all files and directories.
2) Delete any WP files in the root directory. Don’t delete the subdirectory where WP was installed and working. Just delete any WP files in the root – I think you have a copy of index.php in the root – if so, delete it.
3) Go to the directory you just created and copied the root to and open the wp-config.php file with something like Notepad so you can see the database settings. Write down the values for these constants:
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘dbname’/** MySQL database username */
define(‘DB_USER’, ‘dbuser’/** MySQL database password */
define(‘DB_PASSWORD’, ‘dbpassword’);/** MySQL hostname */
define(‘DB_HOST’, ‘dbhost’);In the example above, the values you would copy are: dbname, dbuser, dbpassword, and dbhost. Write down the values for that information that is in the wp-config.php file in the directory of the backup – the backup copy of the subdirectory where you had WP running before starting this entire affair.
4) Download and install the latest version of WP from https://wordpress.org/latest.zip.
Short version of install: download the zip file to your computer. Unzip it. Copy everything in the wordpress directory to the server’s root. Just the contents of the wordpress directory, not the directory itself.
Go to the root of your site in your browser, such as example.com/ The installer should being. When you are asked for the database information, input what you wrote down from the wp-config.php file in step 3.
That should have you up and running with a fresh install of WP in the root.
You’ll have to change any setting you made in the copy of WP in the subdirectory and install any plugins but you should have a WP copy that runs from the root which can access your database as it was when this all started.
If you are unsure about how to do any of the steps, ask me about it first.
I have done a lot of teaching on various computing subjects and, regards of the subject, I will write “Know what you don’t know” on the black/white board, or overhead projected or whatever. I then wait for someone to say something like:
“How can you know what you don’t know? Once you know it you know it and if you don’t know it you don’t know it.”
I then write “Know where you knowledge ends” underneath.
I then explain that when doing anything, you just be constantly asking yourself “Do I know enough to continue?”
If the answer is no, you go read documentation or ask someone before continuing.
Blindly forging ahead in an area you have insufficient knownledged leads to problems, sometimes very big one.
Always be aware of how much you know about the subject at hand.
Let me know if the steps I’ve given you get you a working WP installation in the root directory on the server.
- This reply was modified 7 years, 1 month ago by tferral.
- This reply was modified 7 years, 1 month ago by tferral.
- This reply was modified 7 years, 1 month ago by tferral. Reason: Correcting a quote
- This reply was modified 7 years, 1 month ago by tferral. Reason: Adding text at top about the .htaccess file
I should have said what I was trying to do –
I’ve added “Sticky:” to the front of the type on the posts shown via index.php and wanted to do the same with single.php
It wasn’t, of course, that I was trying to make a sticky post “stick” when displayed via single.php
Just how are stickies treated differently in archives? I was under the impression that the only place they will stick at the top of the page is on the front page of a listing produced via index.php.
The “sticky” class is only added for sticky posts on the first page of the home page (is_home() is true and is_paged() is false)
That is text from https://developer.wordpress.org/themes/functionality/sticky-posts/ near the bottom of the page.
Thanks for the reply.
I realized, an hour or so back, that classes were being created on the fly and not stored in the DB and I figured that was the issue.
Now I think I’ll dig and see where that decision to include sticky is specified and see if there are and hooks there.
Forum: Fixing WordPress
In reply to: Fatal error: Uncaught Error: Class ‘WP_Post_Type’ not found inAre you trying to take a WP installation which is in a subdirectory, such as example.com/wordpress and move it to the root, example.com?
You said you did it “(according to the instructions I found on a website)” Where did you find these instructions? Give me the full URL to them, I’d like to look at what they tell you to do – for future reference, when you refer to something you found on a website, give us the full URL so we can see what you saw.
You say you did a backup – how did you make a backup? There are multiple methods out there and saying you made a backup doesn’t provide enough information to allow us to know exactly what you are talking about.
In software you have to be letter perfect and when asking for help you must tell us everything about what you did and how you did it. I tell people that I’m not physic and can’t read their mind.
Does your site in the subdirectory still work or is it, and the root copy, screwed?
If the subdirectory copy still works, I suggest you install the Duplicator plugin and use it to create copy of the site which you can fairly easily install wherever you want, like in the root.
You are leaving out enough details to make this hard for me to help you.
Always tell more than you think necessary, rather than less.
You said:
I removed the site files from the builder and also the database. I went to the admin dashboard and I changed the Word Press address. Then I modified index php.
What exactly did you do?
How did you move (I hope wasn’t a move not copy) the WP subdirectory contents to the root directory?
What do you mean when saying your removed the site files and database from the “builder” – what “builder”? What files did you remove? How, exactly, did you remove them?
Where in the admin dashboard did you change the WP address and what do you mean by “Word Press address”?
Yous said you updated index.php – I’m assuming you modified the index.php file in the theme’s directory, not one of the index.php files in the WP core directories.
What did you change in the index.php file and why was it necessary to change the index.php file at all?
You said “As those operations weren’t succesfull[sic] I decided to delate[sic] all and to restore my backup.( database backup also).”
What did you delete – everything you had put in the root?
What it comes down to is – does the original site in the subdirectory still work, can you get to the admin pages in order to download, activate, and use Duplicator?
If the original installation in the subdirectory still works download, install, and activate the Duplicator plugin. Use it to make what it calls a Package and an Install.php file.
You then copy the package and install.php to where you want to put the WP installation, give it some information such where it is to reside, the database name and password, and it will install the copy and you should be able to then log in to the site as you did before.
If your original site, in the subdirectory, does not work, I’m not sure what to suggest.
The Duplicator plugin has a bit of a learning curve but once you’ve used it you’ll understand it.
It creates a zipped file containing everything from the site – the database and everything else that isn’t in the database – images, etc.
But, again how did you create your backup and can you restore it to get the subdirectory site working again?
Another tip – when you want to include a multiline PHP error message, use the browser’s display source feature to get to the source. Then select and copy the error messages.
Then go to the message you want to show it in and paste what you copied. Then select what you pasted and click the code button in the formatting bar at the top of the message you are writting. It will be so much easier to read the error messages if you do it this way.
Here’s your error messages added as I just described.
Fatal error: Uncaught Error: Class 'WP_Post_Type' not found in /web/htdocs/www.sentiero625.it/home/wp/wp-includes/post.php:1252 Stack trace: #0 /web/htdocs/www.sentiero625.it/home/wp/wp-includes/post.php(38): register_post_type('post', Array) #1 /web/htdocs/www.sentiero625.it/home/wp/wp-settings.php(312): create_initial_post_types() #2 /web/htdocs/www.sentiero625.it/home/wp/wp-config.php(89): require_once('/web/htdocs/www...') #3 /web/htdocs/www.sentiero625.it/home/wp/wp-load.php(37): require_once('/web/htdocs/www...') #4 /web/htdocs/www.sentiero625.it/home/wp/wp-admin/admin.php(31): require_once('/web/htdocs/www...') #5 /web/htdocs/www.sentiero625.it/home/wp/wp-admin/index.php(10): require_once('/web/htdocs/www...') #6 {main} thrown in /web/htdocs/www.sentiero625.it/home/wp/wp-includes/post.php on line 1252I posted this and then saw that the “code” option does not function as it does on other forums – so ignore what I said about making the error messages easier to read.
As to your problem, give me the information I’ve asked for above and I’ll see if I can get you past this problem.
- This reply was modified 7 years, 1 month ago by tferral.
Forum: Fixing WordPress
In reply to: Editor does not scroll in 5.1 when connected to external monitorThis does not sound like a WordPress problem. Sounds to me that the external monitor is set to a resolution which prevents the entire window to be displayed – too small a resolution.
It’s been a while since I messed with an external monitor on a laptop (I’m assuming that is what you re doing) but there should be a way to set the resolution for an external monitor.
Are you using the external monitor as a second monitor or as a replacement for the laptop monitor. That is, are you setting it up to have two monitors or just one?
Go to Control Panel then to Display and then to Adjust Resolution, a menu item in the upper left corner of the Display panel.
Try setting a larger resolution for the external monitor.
Joy,
Sorry I provided you more information than you wanted.
Joy,
As I said earlier, I’ve taken the Classic theme (a very basic but flawed theme) and used it as the base for a new theme.
There were several formatting errors in the original theme – the left side of the header was “buried” under the left sidebar once I fixed that the sidebar would wind up on the right, but after the post(s). There were other problems which I’ve resolved. I’ve also added a sidebar on the left which will be fixed links for various posts and sites.
I added a container div and put the content div and the sidebar div inside of it with appropriate float and size to get them side by side. I use % as much as possible, instead of px, so that the page will auto adjust in width to be at least usable on any size screen.
Since I’m making my own theme, I’m making it the way I want it –
I’ve left the links on post titles on index pages but removed those on individual posts (index.php vs single.php)
Twenty Nineteen still has the titles as links on single posts as well as indexes.
You can highlight the URL in the address bar of a single post and copy and paste to email the URL. Doing it that way gives you the same URL as if you right clicked the title link and copied the link. It will be a URL, not an anchor tag, and if you want to show some other text in the email, you’ll have to use the link feature in the email program.
As to those links on comments. Some testing shows that that they take you to the top of the comment. Since the link is at the bottom of the comment, this could be a useful feature to allow people to easily go to the top of the comment.
Accordingly, I’ve removed the link from the post time and added “Go to top of this comment’ as a link to the same place. At least the person will know the purpose of the link.
The Classic theme has the comment metadata at the bottom of the comment. I’m going to move it to the top of the comment and put the “go to top of this comment” at the bottom of the comment or perhaps float it in the left margin of the comment.
The Classic theme does not show comments nested as appropriate – I’ll change that also.
I’m also going to alternate the background color of each comment to set them off from the ones above or below them.
I may duplicate the metadata at the bottom of the comment – I haven’t decided.
I’m also considering getting rid of any “text-decoration: none;” CSS rules so that links will, once again as they originall were on the WWW, underlined.
While I care about appearance, for me when it comes to usability, function always trumps appearance.
I just think that some people done click on links because they don’t realize they are a link.
I’m going back to traditional colors for links, visited links, hovered links, etc.
The removal of such indicators for links is, for me, a stupid thing to do and I’d bet it was started by some designer who was more interested in the appearance than the functionality of the site.
I’m going to use
a:link {
color: blue;
}
a:visited {
color: purple;
}
a:active {
color: red;
}Found and fixed.
It was blank lines outside of <?php ?> tags in functions.php
Having found the problem, I did a Google and found this page:
Never Ever Have Blank Lines Outside Your WordPress PHP Tags
I will be checking all my other theme files for unwanted blank lines outside of php tags.
Joy, thanks for the replies.
- This reply was modified 7 years, 1 month ago by tferral.