Forum Replies Created

Viewing 15 replies - 31 through 45 (of 88 total)
  • Thread Starter rocke

    (@shashibhushan)

    In short i cant see my all activity @

    domain.com/members/username/activity/196/

    nothing is seen in above link

    where as active 2 minutes ago dsdsds View

    i can see here my update….

    Thread Starter rocke

    (@shashibhushan)

    any plugin admin

    Thread Starter rocke

    (@shashibhushan)

    its ok, thanks … at least this much can help me

    Thread Starter rocke

    (@shashibhushan)

    Hey Bcworkz,

    Actually i am week and new to JS : hence can you please explain with some example , also pls take URL PARAMETER AS:
    =========
    localhost/project/?page_id=56&motion=aamir-khan&id=2 – where “?motion” is my custom Taxonomy , not custom post . AND pageid=56 is my inquiry page

    Send Details about Motion hence when i come to inquiry page

    my textbox should be fill be : aamir-khan ( as per motion taxnomy )
    and my select option should be selected as : motion ( as per id:2 )
    ==========

    Thread Starter rocke

    (@shashibhushan)

    Hey Bcworkz

    Thanks bro for reply,

    bro, actually the forms and its fields are created dynamic from admin panel of its plugins.

    hence can you please let me know in more details, as in which php files i need to do something .. as its created dynamically hence i don’t see any related code

    Thread Starter rocke

    (@shashibhushan)

    Just i want that,

    when some click localhost/project/?page_id=56&motion=aamir-khan&id=2

    and come to my inquiry page as above link pageid=56 is my inquiry page itself

    then my 2 field i:e Textbox and Select (option)

    should be fill as per URL parameter (query string ) as :

    my textbox should be fill as : aamir-khan ( as per motion taxnomy )
    and my select option should be selected as : motion ( as per id:2 )

    pls help me

    Thread Starter rocke

    (@shashibhushan)

    Hey bcworkz,

    Dude you itself have share such massive knowledge about tax, it was about testing for which you didn’t have some permission .. ok whatever .. thanks once again for your kind support till end.

    Thread Starter rocke

    (@shashibhushan)

    Hey bcworkz,

    Dude thanks once again for your great help , and also for your great knowledge sharing .

    As you said i tried below for test in my function.php ( for pre_get_posts ):

    if( is_main_query() $$ is_tax('motion')) {
       echo '<pre>Motion taxonomy detected</pre>';
    } else {
       echo '<pre>Motion taxonomy NOT detected</pre>';
    }

    And i got message ‘Motion taxonomy detected’ on my custom taxonomy ( motion ) page.

    Also i query:

    if( is_main_query()){echo var_dump($query);}

    i have test with “pre” tag itself .. actually it was not showing in post properly hence removed ??

    and search for motion and i got :

    public ‘taxonomy’ => string ‘motion’

    let me know .
    thanks ??

    Thread Starter rocke

    (@shashibhushan)

    Hey bcworkz,

    First of all i am deeply thanksful for your kind support till now ??

    Dude i have try below one and its seem to work properly till now ,

    function my_custom_exclude_cat( $query ) {
    if ($query->is_tax( 'motion') && $query->is_main_query()) {
            $query->set('category__not_in', array( 1, 2));
        }
    }
    add_action( 'pre_get_posts', 'my_custom_exclude_cat' );

    what you say its perfect or should i used :

    function my_custom_exclude_cat( $query ) {
    if ($query->is_tax( 'motion') && $query->is_main_query()) {
            $query->set('category__not_in', array( 1, 2));
        }
    }
    add_action( 'pre_get_posts', 'my_custom_exclude_cat' );

    OR

    function my_custom_exclude_cat( $query ) {
    if( is_main_query() && 'motion' == $query->get('tax') || $query->is_tax( 'motion')  ){
            $query->set('category__not_in', array( 1, 2));
        }
    }
    add_action( 'pre_get_posts', 'my_custom_exclude_cat' );

    Pls let me know.

    Once again Thanks ??

    Thread Starter rocke

    (@shashibhushan)

    Also like to add :

    cat(1,2,3) where 1-photo,2-video,3-bio.

    About above 4 loop :


    1} this loop is
    Bio of slug excluding cat(1,2)is used as :

    $bio = new WP_Query();
    $bio->query("cat=3&tag='<?php echo apply_filters( 'the_title', $term->slug ); ?>'"); ?>
      <?php  while ($bio->have_posts()) : $bio->the_post(); ?>
       // do stuff;
    <?php endwhile; ?>

    2 } In Second Loop which is getting all post excluding cat(1,2) don’t have WP_QUERY();

    <?php  if ( have_posts() ): while ( have_posts() ): the_post();   ?>
    <?php  endwhile; ?>

    3} All Latest Photos ( cat : 1 )Only of resp. Slug ( aamir,salman,etc..),

    $photo = new WP_Query();
    $photo ->query("cat=1&tag='<?php echo apply_filters( 'the_title', $term->slug ); ?>'"); ?>
      <?php  while ($photo ->have_posts()) : $photo ->the_post(); ?>
       // do stuff;
    <?php endwhile; ?>

    4} All Latest Videos( cat : 2 )Only of resp. Slug ( aamir,salman,etc..),

    $video= new WP_Query();
    $video->query("cat=2&tag='<?php echo apply_filters( 'the_title', $term->slug ); ?>'"); ?>
      <?php  while ($video->have_posts()) : $video->the_post(); ?>
       // do stuff;
    <?php endwhile; ?>

    this is how i am using all above loop in my custom taxonomy(taxonomy-motion.php) page.


    pre_gets_post

    function my_custom_exclude_cat( $query ) {
        if ( !is_home()  ) {
            $query->set('category__not_in', array( 1, 2));
        }
    }
    add_action( 'pre_get_posts', 'my_custom_exclude_cat' );

    Hence how i can use above pre_get_posts action.. so that my 2 loop do-not show cat(1,2) post , but my 3,4 loop doesn’t get effect … and my all loop work properly for resp Slug ( as mention : motion/aamir , motion/salman ..etc — where motion is custom taxonomy , also note i don’t have any custom post type )

    Thanks wait for best

    Thread Starter rocke

    (@shashibhushan)

    hey , i was doing some mistake ,

    function my_custom_exclude_cat( $query ) {
        if ( !is_home()  ) {
            $query->set('category__not_in', array( 1, 2));
        }
    }
    add_action( 'pre_get_posts', 'my_custom_exclude_cat' );

    Above action is working , but is excluding cat(photo : 1, Video : 2) from all .php page, i don’t want …. i want to exclude cat(1,2) only from my custom taxonomy (taxonomy-motion.php) page and that to for 1,2 loop in which its BIO and Latest Posts of resp. SLUG is coming ..

    As in my custom taxonomy (taxonomy-motion.php) page i have 4 Section ( 4 different Loop )

    1 } Is bio Details of resp. Slug ( aamir,salman,etc..) with exclude cat(1,2) ,
    2 } Top Latest Posts of resp. Slug ( aamir,salman,etc..) with exclude cat(1,2) ,
    3 } All Latest Photos ( cat : 1 )Only of resp. Slug ( aamir,salman,etc..),
    4 } All Latest Video (cat: 2)Only of resp. Slug ( aamir,salman,etc..).

    reference : https://www.missmalini.com/aamir-khan-2/

    hence if i use above action then 1 , 2 Loop is working well . But my 3,4 is saying Not Details , as we have exclude cat(1,2).

    So i want to exclude cat(1,2) only from 1,2 loop of my custom taxonomy page

    Thread Starter rocke

    (@shashibhushan)

    Can you please help me how i can do the same in above code… as this is my own custom taxonomy hence , how i can use ‘pre_get_posts’ action under function .php , i have tried below one : but its not working dear :

    function my_custom_exclude_cat( $query ) {
        if ( !is_home()  ) {
            $query->set('category__not_in', array( 1, 2));
        }
    }
    add_action( 'pre_get_posts', 'my_custom_exclude_cat' );

    if i use above action then ID are excluded but all slug link ( motion/aamir , motion/salman ) showing aamir post only , also if you remb in my previous Topic( https://www.ads-software.com/support/topic/post-page-own-page-theme?replies=9 )i had given an reference website link example which is same as my template lookalike , hence if i used above then my Photo and Video section ( which is another wp query loop) goes Blank .

    even tried as per document link :

    function my_custom_exclude_cat( $query ) {
    if (!is_home() ) {
    $query->set('cat', '-1,-2');
    }
    }
    add_action( 'pre_get_posts', 'my_custom_exclude_cat' );

    if i use above action then in all pages this cat id is exclude .
    as i only want to exclude above category id from my custom taxonomy page ( taxonomy-motion.php ) for particular area ( section or only its WHILE LOOP ) as below that i have again call another while ( wp _ query loop ) for Photo and Video section for resp slug… reference : https://www.missmalini.com/aamir-khan-2/

    Thread Starter rocke

    (@shashibhushan)

    Note : i am not using any custom post type … just using custom taxonomy …

    Any one .. need it badly .. pls help me guyss

    Thread Starter rocke

    (@shashibhushan)

    correct : ” now after click on aamir i can only see aamir post excluding photos,video post … similarly for salman and others after using above your code … all page showing aamir post only .. but photos and video category are exclude – ”

    To

    now after click on aamir i can only see aamir post excluding photos,video post … But if i click on salman link or any other link .. then also its showing aamir post only .. its means

    <?php $query = new WP_Query( 'cat=-1,-2 ); ?>
    
     <?php if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); ?>

    after using above code all links have aamir post only.

    but photos and video category are exclude –

    what i do that cat are exclude + each link have its own posts as per taxonomy slug

    Thread Starter rocke

    (@shashibhushan)

    After some research help :

    I changed my code

    <?php if ( have_posts() ): while ( have_posts() ): the_post(); ?>

    With

    <?php $query = new WP_Query( 'cat=-1,-2 ); ?>
    
     <?php if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); ?>

    But my all page shows same posts… actually i have a link some thing like this : test.com/motion/aamir , test.com/motion/salman , test.com/motion/ex … where “motion” is my custom taxonomy and amir,salman ,ex are slug …. now after click on aamir i can only see aamir post excluding photos,video post … similarly for salman and others after using above your code … all page showing aamir post only .. but photos and video category are exclude –

Viewing 15 replies - 31 through 45 (of 88 total)