You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'de limit 0,16' at line 12
SELECT p.*,tp.tpPubl,i.archivo,l.localidad, p.anyoDesde 'desde', case when p.anyoHasta= '3000' then 'presente' else p.anyoHasta end 'hasta' FROM `publicaciones` p left join tipospubl tp on tp.PKtpPubl=p.FKtpPubl left join imagenes i on i.FKrespCabeImpr=p.FKcabecera and i.FKgrupoimg = 2 left join localidades l on l.PKlocalidad=p.FKlocalidad where (p.FKtpPubl in (eclesiastico)) and (p.titulo like '%badajoz%' or l.localidad like '%badajoz%' or p.subtitulo like '%badajoz%') and p.anyoDesde between publicacion/boletin and oficial and p.anyoDesde>0 and p.anyoHasta>0 group by p.FKcabecera order by obispado de limit 0,16