Hisham
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Custom post type auto assign specific categoryThank You for your help, it is much appreciated.
Forum: Developing with WordPress
In reply to: Custom post category not workingThat last bit of code did the trick! Thanks so much for all the help it is very much appreciated.
Forum: Developing with WordPress
In reply to: Custom post type auto assign specific categoryThanks for all your help, I was able to finally get this to work
function auto_select_daily_specials_category( $post_ID ) { $daily_special_cat = get_term_by('slug', 'daily-special', 'category'); if ( !has_term( 'daily-special', 'category', $post_ID ) ) { wp_set_post_categories( $post_ID, array( $daily_special_cat->term_id ), true ); } } add_action( 'save_post', 'auto_select_daily_specials_category' );
This code defaults to daily-post when you open a new post. This works perfectly.
Thanks for all your help I will mark as solved!
Forum: Developing with WordPress
In reply to: Custom post type auto assign specific categoryPardon my ignorance but this still does not work.
When I replace this code :
function special_add_custom_types( $query ) { if( (is_category() || is_tag()) && $query->is_archive() && empty( $query->query_vars['suppress_filters'] ) ) { $query->set( 'post_type', array( 'post', 'specials' )); } } add_action( 'pre_get_posts', 'special_add_custom_types' );
Wit the code you posted above:
function special_add_custom_types( $query ) { if( (is_category() || is_tag()) && $query->is_archive() && empty( $query->query_vars['suppress_filters'] ) ) { $query->set( 'post_type', array( 'post', 'specials' )); $taxquery = array( array( 'taxonomy' => 'daily-special', 'field' => 'slug', 'terms' => 'daily-special', // array(12, 23) 'operator'=> 'IN' ) ); $query->set( 'tax_query', $taxquery ); } } add_action( 'pre_get_posts', 'special_add_custom_types' )
It no longer registers my old Special post on the front page and any new special posts I make do not end up in the daily-special category?
I must be misunderstanding what to do ?
Thanks.
Forum: Developing with WordPress
In reply to: Custom post type auto assign specific categoryThanks for your response, I am having trouble making this work, here is what I did:
function special_add_custom_types( $query ) { if( (is_category() || is_tag()) && $query->is_archive() && empty( $query->query_vars['suppress_filters'] ) ) { $query->set( 'post_type', array( 'post', 'specials' )); $taxquery = array( array( 'taxonomy' => 'category/daily-special', 'field' => 'term_id', 'terms' => 'daily-special', // array(12, 23) 'operator'=> 'IN' ) ); $query->set( 'tax_query', $taxquery ); } } add_action( 'pre_get_posts', 'special_add_custom_types' );
Is ‘taxonomy’ => ‘category/daily-special’, not supposed to be category/then the category I want, and ‘terms’ => ‘daily-special’ are the two items I set to use the category daily-special.
Thanks
Forum: Developing with WordPress
In reply to: Custom post category not workingOk after some googling around since I knew it was not a Divi specific issue I found a bit of code added to the child theme below the custom post code to make it all work.
function special_add_custom_types( $query ) { if( (is_category() || is_tag()) && $query->is_archive() && empty( $query->query_vars['suppress_filters'] ) ) { $query->set( 'post_type', array( 'post', 'specials' )); } } add_action( 'pre_get_posts', 'special_add_custom_types' );
The above together with the top bit of code makes it fully functional!
One last question, is it possible to make the post default to checking the category daily-specials so the user does not need to check the box?
Thanks
- This reply was modified 1 year, 2 months ago by Hisham.
Forum: Developing with WordPress
In reply to: Custom post category not workingThanks for your reply.
I have tried the above code snipped with no luck. The blog module on the homepage is selected to show 1 post (most recent) from the Daily Specials category. The test post I made shows in the Specials list with category of Daily Specials.
As far as plugins, I have woocomerce, divi tourque lite, wp super cache, and a custom plugin (Ctrl Login) I use to white label the login screen and admin area.
I tried creating a test page using default editor to remove Divi from the equation, when I use the post list block and set Daily Specials to the category I still dont see my test special post that I created. This makes me thing its not being registered correctly with WordPress?
Thanks.
- This reply was modified 1 year, 2 months ago by Hisham.
Forum: Plugins
In reply to: [Simply Static - The WordPress Static Site Generator] Icons missingSo for anyone dealing with this issue later I messed with this for a while. Just adding the wp-content folder to the added URL’s didnt work I needed to add the sub folder that goes to the icons for DIVI and that solved my issue.
Thanks for your help!
Forum: Plugins
In reply to: [Simply Static - The WordPress Static Site Generator] Icons missingSo I think I have figured out the issue but I am not sure how to fix it.
The non static site is subdomain.domain.com and the static site is domain.com (example). The font awesome icons used in Divi builder are located in wp-content/themes/Divi/core/admin/fonts/fontawesome/ and they are being copied to domain.com. When I inspect the missing icons it is looking for that resource in subdomain.domain.com (the non static site).
I don’t keep subdomain.domain.com up when I am not making edits or generating a new static site. I have done it this way for some time with no issue. Now without subdomain.domain.com not up the icons break. If I leave subdomain.domain.com up the icons are not broken. This will work but is not ideal I would rather subdomain.domain.com not be up at all so google does not try to index it as this is a rather high traffic site and I don’t want the confusion.
This only seems to be an issue with font awsome icons no other logos or images/content is doing this.
Any help is greatly appreciated, thanks.
@mohammedeisa thanks for your help. I will try to setup an entirely new server with mysql as mariadb and mysql are conflicting packages in the OS that I use for all my servers.
Thanks again!
@mohammedeisa thanks so much for your quick response.
My situation is I have a server A with a wordpress already running on mariadb and I have another wordpress on server B using mysql. I need to put the mysql site from serve B onto server A.
What is my best bet? Can I convert the SQL dump to be mariadb compatible? Or do I have to run a simultaneous mysql instance on serve A?
Any help is much appreciated. Thanks.
- This reply was modified 1 year, 5 months ago by Hisham.
Lazy load is definitely an issue for obvious reasons. But Robo gallery is got a bit more going on because not photos show at all.
Simply Static is to good to return to a standard WordPress so I am in the process of finding a gallery site that can be hosted elsewhere and embedded into my page to avoid the whole issue.
The other alternative is to leave the dev site up and password protected because robo gallery pulls them from the dev site. This is not preferred for me I much prefer the security of it being inaccessible unless I am using it real time.
Some info I want passed along in this thread.
I ended up using the standard gallery in Divi (although I am sure the standard gallery works the same). What I noticed is that only the photos visible on first page of the gallery would show up in the static generation. The rest would be broken links. I believe this is due to the way Simply Static views the page it does not scroll and trigger the lazy load function or gallery pages themselves.
So to fix the gallery issue I had to use the standard gallery module in Divi and set all the photos to be visible on page load (set default amount of photos to view larger then or equal to the total number of photos in that gallery).
I also ran into another issue which may end up being helpful to someone else reading this. The plugin Autoptomize minifies javascript/css/html and the likes making for even faster load times (tested with gtmetrix.com). That being said it use a CDN system for photos that hosts them elsewhere but using the domain as a key somehow. So this causes the source for the photos to be based on the domain you generated from which for me is not the domain my site lives on. If you do not turn that feature off you will get some photos showing up in galleries and some not with no real rhyme or reason to it. Luckily is a setting that can be turned off but it is on by default.
Hope this helps someone else along the way. As far as I can tell Robo gallery is a no go for simply static.
Forum: Plugins
In reply to: [Simply Static - The WordPress Static Site Generator] Lates update issue@patrickposner worked like a charm!
Thanks so much
Forum: Plugins
In reply to: [Simply Static - The WordPress Static Site Generator] Lates update issue@patrickposner Thanks for your response.
Just to clarify your saying upgrade to 2.3.0 and then add that filter to my functions.php and see if it solves the issue?
(I have a catch all plugin I use for this type of stuff so I can add it there)