Indlela yokudibanisa iiPosti kunye neentlobo zePosti yeSiko kwiMibuzo ye-WordPress kunye ne-RSS Feed

I-WordPress okanye i-Elementor Hlanganisa okanye udibanise iiPosti kunye neentlobo zePost Custom kwi-Query

Enye yezona zinto zimangalisayo zeWordPress kukukwazi ukwakha Iindidi zePosi yesiqhelo. Oku bhetyebhetye kuyamangalisa... njengoko iindidi zeposi ezilungiselelweyo zinokusetyenziselwa ishishini ukucwangcisa ezinye iindidi zezithuba njengemisitho, iindawo, ii-FAQs, izinto zepotfoliyo ngokulula. Unokwakha iitaxonomi zesiko, iindawo ezongezelelweyo zemethadatha, kunye neetemplates zesiko lokubonisa.

Kwindawo yethu ku Highbridge, sinodidi lweposi olulungiselelweyo iiprojekthi ukongeza kwibhlog yethu apho sabelana ngeendaba zenkampani. Ngokuba nohlobo lweposi olulungiselelweyo, siyakwazi ukulungelelanisa iiprojekthi kumaphepha ethu okukwazi… ke ukuba ujonga ezethu Iinkonzo ze-WordPress, iiprojekthi esisebenze kuzo ezinento yokwenza neWordPress ziya kuzibonakalisa ngokuzenzekelayo. Ndisebenza nzima ndizama ukubhala zonke iiprojekthi zethu ukuze iindwendwe zethu zesayithi zibone uluhlu lomsebenzi esiwenzela iinkampani.

Ukudibanisa izithuba kunye neentlobo zePost Custom

Iphepha lethu lasekhaya sele libanzi, ngoko ke andikhange ndifune ukwakha icandelo lezithuba zethu zebhlog KUNYE necandelo leeprojekthi zethu zamva nje. Ndifuna ukudibanisa zombini izithuba kunye neeprojekthi kwimveliso efanayo usebenzisa umakhi wethu wetemplate, Mlawuli. I-Elementor ayinayo i-interface yokudibanisa okanye ukudibanisa izithuba kunye neentlobo zeposi, kodwa kulula kakhulu ukwenza oku ngokwakho!

Ngaphakathi kwephepha lomxholo wemisebenzi.php womntwana wakho, nanku umzekelo wendlela yokudibanisa ezi zimbini:

function add_query_news_projects( $query ) {
	if ( is_home() && $query->is_main_query() )
		$query->set( 'post_type', array( 'post', 'project' ) );
	return $query;
}
add_filter( 'pre_get_posts', 'add_query_news_projects' );

Isihluzi se-pre_get_posts sikwenza ukuba uhlaziye umbuzo kwaye uwusete ukuze ufumane iposi yakho kunye iprojekthi uhlobo lweposti yesiko. Ewe kunjalo, xa ubhala ikhowudi yakho kuya kufuneka uhlaziye uhlobo lweposti yesiko ukuya kweyona ndibano yakho yamagama.

Ukudibanisa izithuba kunye neentlobo zesiThuthi esiSiko kuMxholo wakho

Ndinayo nesiza esizipapasha ngokuzenzekelayo kumajelo asekuhlaleni ngokutya kwayo… ngoko bendifuna ukusebenzisa umbuzo ofanayo ukuseta i-RSS feed. Ukwenza oku, kufuneka ndongeze inkcazo OKANYE kwaye ndibandakanye yi_yondliwa.

function add_query_news_projects( $query ) {
	if ( is_home() && $query->is_main_query() || is_feed() )
		$query->set( 'post_type', array( 'post', 'project' ) );
	return $query;
}
add_filter( 'pre_get_posts', 'add_query_news_projects' );

Ukudibanisa izithuba kunye neentlobo zePost Custom kwi-Elementor

Elinye inqaku… Mlawuli inophawu oluhle kakhulu apho unokwazi igama kwaye ugcine umbuzo kwisayithi yakho. Kule meko, ndakha umbuzo obizwa ngokuba ziiprojekthi zeendaba kwaye emva koko ndingayibiza kwi-Elementor interface yomsebenzisi kwicandelo le-Posts Query.

function my_query_news_projects( $query ) {
	$query->set( 'post_type', array( 'post', 'project' ) );
}
add_action( 'elementor/query/news-projects', 'my_query_news_projects' );

Nantsi indlela ekhangeleka ngayo kwi-Elementor interface yomsebenzisi:

umbuzo wezithuba ze elementor

Ukubhengezwa: Ndisebenzisa eyam Mlawuli ikhonkco lokudibana kweli nqaku.