joshrodgers
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Admin Search Custom Post TypeFigured it out!!
I didn’t realize this…but I had this code in my functions file: https://pastebin.com/PVaYWQzL. Little did I know it affected both the front-end and back-end.
After I removed the code, my search worked!!
Thanks,
JoshForum: Fixing WordPress
In reply to: Default TaxonomiesI decided to can the taxonomies and take another approach! It would be nice if there was a solution for this, but I decided to take another route ??
Thanks,
JoshForum: Fixing WordPress
In reply to: Admin Search Custom Post TypeSwanson,
This is helpful for front-end searches, but not back-end searches. The WordPress back-end (or admin panel) is only searching through posts not custom post type posts. I was hoping there was some kind of filter or piece of code I was missing that would enable me to do that ??
Thanks,
JoshForum: Fixing WordPress
In reply to: Hide Meta Boxes on Custom Post TypeThis code goes in your functions file: https://pastebin.com/FntxMzGb
All you have to do is change “frog” on line 4 to match your custom post type name. *If you just want it for normal posts change “Frog” to “post”.
By default WordPress will not show anything in the array on line 5…so…if I wanted to hide my excerpt I would remove postexcerpt from the array.
That’s it!! ??
NOTE: This sets the default screen options, so if you have changed the options you may have to change the name of your custom post type or clean your database in order for the code to work.
Forum: Themes and Templates
In reply to: Excerpt Custom Post TypeThis code goes in your functions file: https://pastebin.com/FntxMzGb
All you have to do is change “frog” on line 4 to match your custom post type name. *If you just want it for normal posts change “Frog” to “post”.
By default WordPress will not show anything in the array on line 5…so…if I wanted to hide my excerpt I would remove postexcerpt from the array.
That’s it!! ??
NOTE: This sets the default screen options, so if you have changed the options you may have to change the name of your custom post type or clean your database in order for the code to work.
Forum: Themes and Templates
In reply to: Category for Custom Post TypeMe too ??
Forum: Themes and Templates
In reply to: Category for Custom Post Typekessiemeijer,
The taxonomy solved my problem!!
Ok, so all I had to do was add the following to my functions file: https://pastebin.com/H00nfgx2.
“menu” is the name of my custom post type, if you’d like to add it to a normal post, all you have to do is change “menu” to “post”.
The title is “Categories”, to change this to read something else look under label in the array and change the word “Categories” to “Your Title”.
Very simple! Works like a champ!!
Thanks,
JoshForum: Themes and Templates
In reply to: Blog MetaboxMission accomplished!!
On my page I had the following code: https://pastebin.com/D5JJQK56, which didn’t work on my blog page.
All I needed to do to fix it was use a specific page id, instead of using a global post id.
Line 2 is the only thing that changes:
https://pastebin.com/D5JJQK56 becomes https://pastebin.com/nyxSdtR0 (just replace 17 with the id of your blog page).
The only thing I don’t like about that is if the id of my blog page changes, I have to update the code, but it works, so I’m happy ??
Hope this helps someone!
Josh
Forum: Themes and Templates
In reply to: Blog MetaboxAdding a more bizarre twist…
I created a page template using the code for my index.php page and it plays the sound just fine, for some reason if I select it as the “Posts page” under Reading, that’s when it have the issue.
What changes when you select the page as the “Posts page”?
So strange ??
Thanks,
JoshForum: Themes and Templates
In reply to: Blog MetaboxOk, so I went through and evaluated the metabox code I was using…because, originally, I cut the code and pasted it from a tutorial I found.
Now the code looks like: https://pastebin.com/QL6TuVSv, which is much easier to read and follow ??
Unfortunately, I still have the same problem ??
What I’ve noticed is that it’s just not retrieving the metabox content if it’s on the blog page…my condition for displaying the code is returning false. When I remove the condition, the code appears, but it doesn’t get the filename from the metabox ??
hmmmm……..
Any ideas?
Josh
Forum: Themes and Templates
In reply to: Attachment URLI solved the problem ??
Ok, my custom meta box code didn’t change, it still looks like: https://pastebin.com/aVt5FxNk
My original template code looked like this: https://pastebin.com/414Hj6Af
I did a few things to make this work:
First…I defined my upload directory: https://pastebin.com/jpTLCTfs
Then…I defined my filename: https://pastebin.com/ss0kTkbH
After that…I changed line 3 of my original template code. Instead of: https://pastebin.com/gGuU0hKA my code looks like: https://pastebin.com/K0gE8CNA.
The line adds the upload directory, a slash, the filename and then a replace to remove the spaces and replace them with hyphens in the filename (because WordPress automatically removes the spaces and adds hyphens to the actual filename).
All together, the final code looks like: https://pastebin.com/n8272A44
Once you have the link, then you can use it as a background sound or in a music player. Just make sure you use line 7 of https://pastebin.com/n8272A44 as your embed source.
That’s it! Not too bad ??
JoshForum: Themes and Templates
In reply to: wp_page_menu different classesThank you Navaratnam, you were right! Because the code was being added by a filter, it was applying the code to every instance of the wp_page_menu function, instead of the specific instance I had intended.
To solve this, I took the code from my functions file (https://pastebin.com/2frXmyHL) and deleted it completely, eliminating the filters I set on the wp_page_menu function.
Then I took my existing code (https://pastebin.com/9Sa6jTnG) and added the preg_replace to the last line.
So, now my code looks like this: https://pastebin.com/qBtnaNr9. The only thing that changed was line 14 of the code.
So, all I do, is apply the code to the instance or instances of the wp_page_menu function that I need to change and presto! The change only gets made to the instance or instances I specify ??
Hopefully this helps some out there!
Josh
Forum: Fixing WordPress
In reply to: Metabox Not SavingI found the solution…all I did was replace the save function with this one: https://pastebin.com/vjE9N0fJ.
I found that from: https://wordpress.stackexchange.com/questions/14282/custom-post-type-metabox-not-saving (the 1st answer – with a green checkmark next to it)
So, all together, the final code looks like: https://pastebin.com/EzAix8Sg
Hope this helps someone ??
Josh
Forum: Fixing WordPress
In reply to: Metabox Not SavingI am creating a custom post type with a price meta box. I can add a price, but after a few minutes the value I entered disappears or clears…it’s like it’s saving it temporarily but not permanently, how can I make it save permanently?
I have the following code: https://pastebin.com/QytnUf55
Thanks,
JoshForum: Fixing WordPress
In reply to: Parent arrow for submenu