R22
Forum Replies Created
-
Thank you for your answer.
and where could I find shortcode which can do that please?
Forum: Plugins
In reply to: [Polylang] How to translate hardcoded contentOh, never mind. I have already figured it out. I apologize for this thread, you can close it now.
Forum: Networking WordPress
In reply to: Multisite newbie questions3, I mean I want users on my site to be able to add some text about themselves, age, favourite sport etc. these kind of things.
Thank you guys for your answers.
Forum: Fixing WordPress
In reply to: Tags related custom postsSo I figured it out. The problem was I didn’t have the ‘post_type’ defined in $args for new WP_query
It works now
Forum: Fixing WordPress
In reply to: Tags related custom postsHi alchymyth,
no, there is no custom taxonomy, I used taxonomy Tags, which is included in WP by default. I just assigned this default Tags taxonomy to my Custom Post Type “products” so I could use it. I hope you know what I mean.
So basically, I want to use default ‘post_tag’.
what is the result if you add a test output after this line:
$taxs = wp_get_post_terms( $post->ID );
for example with:
var_dump( $taxs );The output of var_dump ($taxs; is this:
array(2) { [0]=> object(stdClass)#2337 (9) { [“term_id”]=> string(2) “13” [“name”]=> string(5) “Tag 1” [“slug”]=> string(5) “tag_1” [“term_group”]=> string(1) “0” [“term_taxonomy_id”]=> string(2) “16” [“taxonomy”]=> string(8) “post_tag” [“description”]=> string(0) “” [“parent”]=> string(1) “0” [“count”]=> string(1) “3” } [1]=> object(stdClass)#2338 (9) { [“term_id”]=> string(2) “11” [“name”]=> string(5) “Tag 2” [“slug”]=> string(5) “tag_2” [“term_group”]=> string(1) “0” [“term_taxonomy_id”]=> string(2) “14” [“taxonomy”]=> string(8) “post_tag” [“description”]=> string(0) “” [“parent”]=> string(1) “0” [“count”]=> string(1) “3” } }
I guess that is correct, because I added 2 tags to my custom post (‘Tag 1’ and ‘Tag 2’ are names of tags assigned to this custom post)
Forum: Plugins
In reply to: [Advanced Custom Fields (ACF®)] How to display custom image field in foreachok so I found I need to add get_field funciton in my file, so the code looks like this now:
<?php $this_category_id=get_query_var('cat'); $args=array( 'parent' => $this_category_id, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0 ); $categories=get_categories($args); $image_url=get_field('obrazek_podkategorie', 'category_'. $category->cat_ID .''); foreach($categories as $category) { echo '<img src="'. $image_url .'"/>'; echo '<b>'. $category->name .'</b>'; echo '<p>'. $category->description .'</p>';} ?>but it doesn’t work because (I think) in this function
get_field('obrazek_podkategorie', 'category_'. $category->cat_ID .'')
the part
'category_'. $category->cat_ID .
doesn’t return category ID..how should I fix it? any help pls?
Forum: Plugins
In reply to: [Site Background Slider] Images displaying over everythingI have the same issue. Does anybody know how to fix it please?
Forum: Themes and Templates
In reply to: Page Templates and homepageThank you very much 🙂