Sero Theme Events/New Problems
-
I am using the Sero theme. I recently upgraded to 2.8 and the Events and News portions of the sidebar are now causing problems. All posts show up in the news tab. Nothing appears in the Events tab. In the Sero Theme setup section there are no longer any items in the drop down menu for either the new or events setup. Any help would be appreciated.
-
Hey Scott! (actually I went to school w/brooke)
I’m having the same problem. w/my site. https://www.slaterbaptistchurch.org
any help anyone could give would be much appreciated! Thanks!
-WillSame problem here – I installed with WP 2.8 – and it has never worked. My posts to Aaron – the theme developer – sit awaiting moderation for weeks…
I am thinking it is sopmething in the upgrade interfering with the feed…
It couldn’t be something daft like the date formats… could it?/????
Any help would be most welcome… and if I find anything, I will post here.
-SimonI ran the query in the function get_upcomping_events() directly against the database, and got the following error:
#1054 – Unknown column ‘$sero_events_id’ in ‘where clause’
That narrows it down a bit.
BTW – I have 4 MySQL databases running in this domain… But I don’t think that is the problem.
Here is the full result from running the query…
Error
SQL query: Documentation
SELECT DISTINCT *
FROM wp_posts AS posts
LEFT JOIN wp_term_relationships ON ( posts.ID = wp_term_relationships.object_id )
LEFT JOIN wp_term_taxonomy ON ( wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id )
WHERE 1 =1
AND wp_term_taxonomy.taxonomy = ‘category’
AND wp_term_taxonomy.term_id
IN (
$sero_events_id
)
AND (
posts.post_status = ‘publish’
OR posts.post_status = ‘future’
)
AND (
posts.post_type = ‘post’
)
AND posts.post_password = ”
AND (
posts.post_date >= NOW( )
)
GROUP BY posts.ID
ORDER BY posts.post_date ASC
LIMIT 0MySQL said: Documentation
#1054 – Unknown column ‘$sero_events_id’ in ‘where clause’I am improvising here! $sero_events_id is a php variable… so I am tracing that… and will replace it in the query with a value… or just delete the clause.
Anyone have any luck finding a solution for this?
Also, under the Sero Theme admin page the News & Events categories don’t show up under Main Navigation, Footer Navigation, nor The 3 Big Links. So I am unable to select those to show up in the navigation areas.
I examined the MySQL database and found that the term_id for the Events category was 10, in my database. (That all depends on the order in which you create categories!
I re-ran the query directly against the database, insertingthe value 10 as follows:
SELECT DISTINCT *
FROM wp_posts AS posts
LEFT JOIN wp_term_relationships ON ( posts.ID = wp_term_relationships.object_id )
LEFT JOIN wp_term_taxonomy ON ( wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id )
WHERE 1 =1
AND wp_term_taxonomy.taxonomy = ‘category’AND wp_term_taxonomy.term_id = 10 // This is the clause I changed//
AND (
posts.post_status = ‘publish’
OR posts.post_status = ‘future’
)
AND (
posts.post_type = ‘post’
)
AND posts.post_password = ”
AND (
posts.post_date >= NOW( )
)
GROUP BY posts.ID
ORDER BY posts.post_date ASC
LIMIT 0The result of this was the information that no rows were found. There is clearly something wrong in this query – it should deliver one row of data in my database – since I have one future event in the Events category.
I am now dissecting teh query clause by clause. Will keep you “posted”.
By the way, right now, ALL my posts only seem to go to the News tab – and nowhere else! Hmmm… I might have to raid another theme for code that works!Simon Carter
Leaphrog Design
https://www.leaphrog.co.ukSimon,
Thanks for your work! I’m a little out of my element when it comes to the intricacies of php coding. Anything beyond the basics and I am lost. I’ll be anxious to see the results of your efforts. Thanks again.
Scott
I now find that actually NO posts are posting correctly….
so I am going to pull this SQL query down to basics to see which part does not work…I am recording this all here partly for myself… so don’t worry if you don’t get what I am doing… because neiother do I! Haha
The query works fine until the LAST LINE which limits the number of returned records to a maximum of … wait for it… 0!
Working on solution and testing it, now.
OK – The EVENTS part is working now… although it is a clumsy fix… because I think there is a backend problem – for example, when I set which category to feed to NEWS and EVENTS, there is nothing appearing in the drop-downs… so THAT is where the real problem is.
The work-around is good, as long as you know what is the
-
term_id
for the Events category (In MY database, it is 10)
From the WP Dashboard… select >Appearance>Editor
on the right side choose the Theme Functions (functions.php).Scroll down to line 185, which is in the function get_upcoming_events().
************ IMPORTANT***********************************************
COPY the whole line to Notepad or somewhere as a back-up, in case you need to restore it!
*********************************************************************
Did you do the above? If not… GO BACK AND DO IT NOW!This line creates an SQL query in the form of a text string… and assigns it to a variable called $query. It is a very long line…. You need to find the section that says…
AND wp_term_taxonomy.taxonomy = ‘category’
AND wp_term_taxonomy.term_id
IN (
$sero_events_id
)and change it to:
AND wp_term_taxonomy.taxonomy = ‘category’
AND wp_term_taxonomy.term_id
= 10or – whatever your particular EVENTS category term_id IS (Mine is 10)
Next, go to the END of the same line… to the expression…
LIMIT 0
and change it to:
LIMIT 0, 5 This allows up to 5 future events to be displayed… in the EVENTS tab. You can make it any number you like…
NOW, I still have ALL posts appearing on the NEWS tab… so I will work on making that just display the NEWS category…
I will use the same code as the amended code above, but change the category_id to the NEWS category ID… and set it to show the five most recent PAST events. I will document that later.
If anyone is following all of this… please DO NOT IMPLEMENT what I have documented so far.
It IS a work-around, and has helped me to understand the true problem, which is on the SERO THEME SETTINGS page under NEWS & EVENTS. Data is not being correctly transferred between the database Categories and the drop-down boxes, or from the max limit settings… as a result, the VARIABLES which are after supposed to hold these settings are empty.
My work-around placed the values directly into the query without requiring the variables, BUT a more complete fix is to fix the original problem.
Sorry if I am cluttering up this post topic… if anyone really wants me to stop – or wants to take the problem on from here on their own, I hope they find my comments useful.
Otherwise, I will just continue. I hope for a fix within two or three days.
Simon,
Again thank you. I continue to follow and appreciate your work!
Scott
OK Scott….
Good and bad news…
I DOWNGRADED WordPress for this site to 2.7.1 using the instructions at https://techie-buzz.com/wordpress/downgrade-uninstall-wordpress-28.html
I then found that the NEWS category works ok – but still the same problem with the Events category…
Can I ask, which version of WordPress were you using when it all worked OK?
Currently, the whole Church Web Developer site seems to have been taken offline – which does not give me confidence that Sero will be upgraded any time soon!
I am going to try making the changes I noted above to get the Events Tab working… in conjunction with the downgrade to make the News tab work – and I may have a working site… Assuming normal posts will go where I want them to!
OK – NOW my site works using the EVENTS and NEWS tabs as they should work.
Problems still, in that I cannot get any OTHER posts to appear – but this does not matter to me, since this site is fairly static (except for NEWS and EVENTS).
****************
Solution Stage 1:DOWNGRADE WordPress installation to version 7.2.1, using the instructions at: https://techie-buzz.com/wordpress/downgrade-uninstall-wordpress-28.html
This will allow you to configure the NEWS category correctly in the Admin page. The EVENTS drop-down is still blank.
DO NOT BE ALARMED when you have completed your downgrade, if WordPress tells you you have to UPGRADE your admin pages when you log in to Admin. This is ok – it is only the Admin zone that is upgraded again, and the back-end is still 7.2.1 (You will see this at the top of the admin screen where you are continuously prompted to upgrade to 8.2.1. Learn to live with it!
The zipped backup of my database needed to be UNZIPPED before it was successfully re-uploaded and imported.
*****************
Solution Stage 2:You need to find the term_id for the Events category. You cannot set it using the Admin tools, because it is not working, so you have to do it manually.
Your EVENTS category has a “term_id” which you will need. It is an integer number probably between 1 and however many categories you have made (ever). You can use trial and error here – OR go into the database using PhpMyAdmin and look in the table wp_term_taxonomy which contains this field.
*****************
Solution Stage 3:Get the EVENTS tag working by editing the file function.php (THEME FUNCTIONS) under APPEARANCE > EDITOR. Scroll down to line 185 (although the line numbers in 2.7.1 have now disappeared!!!!) so you can search )(find) the comment line… //Get events
Beneath it you will find the code for the function get_upcoming_events().
It is the line beginning with “$query” that you need to edit. It contains the expression:
WHERE 1 =1
AND wp_term_taxonomy.taxonomy = ‘category’
AND wp_term_taxonomy.term_id
IN (
$sero_events_id
)My term_id for Events category was 10, so I changed the expression above to:
WHERE 1 =1
AND wp_term_taxonomy.taxonomy = ‘category’
AND wp_term_taxonomy.term_id
= 10*****************
My News and Events tabs now both work as expected.Hope it helps.
If you have difficulties with any of this, let me know if you need more detail.
********************************************************************
I can walk you through the database bits if you need help but probably need to fix a time for real-time chat for this. I used PhpMyAdmin, through the C Panel interface of my hosting company. I had not don it before – although I know databases quite well. “But screw (y)our courage to the sticking place and (you)’ll not fail!) (Macbeth)(-ish)
Simon,
I got it to work. I had to manually adjust the sidebar code to tell the theme what category news was supposed to be (everything was showing up). It looks like everything is good now! Thanks for your help.
Scott
- The topic ‘Sero Theme Events/New Problems’ is closed to new replies.